#1447 new
Arwen eVenster

addSelectedItem is not defined

Reported by Arwen eVenster | December 17th, 2019 @ 12:24 PM | in User issues

List builder control not working in forms due to reference error.

Comments and changes to this ticket

  • dleffler

    dleffler February 26th, 2020 @ 03:54 PM

    • Assigned user changed from “expNinja” to “dleffler”
    • Milestone set to 2.5.1

    What theme style were you using? And what activity were you in the process of performing?

  • Arwen eVenster

    Arwen eVenster February 27th, 2020 @ 08:17 AM

    Hi Dave,

    Using 2.5.0, p3 with bootstrap4. Adding form controls using this control (radio buttons, drop down list) are not working. Not able to add or remove options.

  • dleffler

    dleffler February 27th, 2020 @ 02:54 PM

    The only thing that might cause this error is that the /framework/core/forms/controls/listbuildercontrol.js script is not being loaded. I can't reproduce the error locally.

    You might try opening the browser developer window and reloading the page to see if/why the listbuildercontrol.js script isn't loading.

    Do you possibly have 'minify' turned on?

  • Arwen eVenster
  • Arwen eVenster

    Arwen eVenster February 27th, 2020 @ 03:47 PM

    ...But that is not the problem

    dev tools tells me: @random5dc1995ee346d:1 Uncaught ReferenceError: addSelectedItem is not defined
    at HTMLButtonElement.onclick (@random5dc1995ee346d:1) when I try to add an item option, in this case a radio button group

  • dleffler

    dleffler February 27th, 2020 @ 07:52 PM

    FYI, the addSelectedItem is only found in that script. I was able to reproduce it once, but have been unable since. In practice we seem to load that script twice via XHR since the bootstrap 3/4 form designer is all Ajax driven now, therefore not minified.

    If you use the 'network' tab of the browser development window then select 'XHR' and then edit the radio or drop down control you should see the Ajax link appear and then 4 scripts with the above-mentioned script twice.

  • Arwen eVenster
  • dleffler

    dleffler March 10th, 2020 @ 07:16 PM

    • Milestone changed from 2.5.1 to 2.5.2
  • dleffler

    dleffler April 3rd, 2020 @ 01:42 PM

    • Milestone changed from 2.5.2 to User issues
  • Arwen eVenster

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Bug Tracker for Exponent CMS

Shared Ticket Bins

People watching this ticket

Attachments

Pages