Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addSelectedItem is not defined #1488

Open
exponentcms opened this issue Apr 28, 2020 · 9 comments
Open

addSelectedItem is not defined #1488

exponentcms opened this issue Apr 28, 2020 · 9 comments
Assignees
Milestone

Comments

@exponentcms
Copy link
Owner

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

@exponentcms
Copy link
Owner Author

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

@exponentcms
Copy link
Owner Author

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.

@exponentcms
Copy link
Owner Author

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?

@exponentcms
Copy link
Owner Author

I do have minify on...

@exponentcms
Copy link
Owner Author

...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

@exponentcms
Copy link
Owner Author

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.

@exponentcms
Copy link
Owner Author

Added a screenshot...

@exponentcms
Copy link
Owner Author

[bulk edit]

@exponentcms
Copy link
Owner Author

@exponentcms exponentcms added this to the User Issues milestone Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants