Hi devs,
I'm working in a Jenkins plugin and I'm struggling with an issue. AFAIK in
order to populate select combo using web methods the common pattern to
follow is to add this type of methods in the Descriptor class, as you can
see below:
*public ListBoxModel doFillXXX(){*
* ListBoxModel m = new ListBoxModel();*
* for(){*
* ... *
* m.add(displayName, name);*
* }*
* return m;*
*}*
However when the list is empty, so there is just the m object without
Options I have an error in the Javascript select.js file. The error is this:
*Uncaught TypeError: Cannot read property 'value' of undefined*
* hasChanged @select.js:46*
* updateListBox.onSuccess @select.js:76*
* config.onSuccess @select.js:32*
* Ajax.Request.Class.create.respondToReadyState @prototype.js:1657*
* Ajax.Request.Class.create.onStateChange @prototype.js:1600*
* (anonymous function) @prototype.js:414*
and in that line of the select.js file you can see:
*Behaviour.specify("SELECT.select", 'select', 1000, function(e) {*
* function hasChanged(selectEl, originalValue) {*
* var firstValue = selectEl.options[0].value;*
* var selectedValue = selectEl.value;*
* if (originalValue == "" && selectedValue == firstValue) {*
* // There was no value pre-selected but after the call to
updateListBox the first value is selected by*
* // default. This must not be considered a change.*
* return false;*
* } else {*
* return originalValue != selectedValue;*
* }*
* };*
So, it seems like not adding options to the select causes this issue.
Probably I'm making some type of mistake or maybe I'm missing something.
Any help will be welcome. My Jenkins version is 1.644.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/f3f34eb7-9cf5-4963-a367-16fe52377691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.