Problem solved: I've debugged Jenkins, and a breakpoint in
ExpressionFactory2 has told me the truth. :-)

As I've stated previously, the select.jelly contains an instruction:
${descriptor.calcFillSettings(field,attrs)}

But this expression relies on the presence of a descriptor variable, which
is not defined by the Jenkins environment itself. I've added the line
<j:set var="descriptor" value="${it.descriptor}" />
in my jelly files (before the select), and the dynamic listbox is now
filled.



Le Thu Feb 12 2015 at 2:00:31 PM, Ivo Bellin Salarin <
[email protected]> a écrit :

> Thanks Ulli,
>
> I have followed your hints:
> 1) I've implemented a RootAction which has a @DataBoundConstructor and no
> @Extension
>     1.1) this requires an explicit registration of the action in the
> jenkins instance actions: the @Extension attribute helps the automatic
> discovery of the root action
>
> 2) I've implemented a simple Action with the same characteristics of the
> RootAction in (1)
>
> For both those actions, the listbox content is not filled. The @fillUrl
> attribute is simply missing. I am going to debug Jenkins.
>
> Thanks for your attention.
> (all this code is available on
> https://github.com/nilleb/jenkins-plugins/tree/master/rootaction-example-plugin/
> )
>
> Le Wed Feb 11 2015 at 12:44:15 PM, Ulli Hafner <[email protected]>
> a écrit :
>
> And shouldn’t there a @DataBoundConstructor constructor for your action?
>> Example: https://github.com/jenkinsci/warnings-plugin/
>> blob/master/src/main/java/hudson/plugins/warnings/ConsoleParser.java
>>
>>
>> Am 11.02.2015 um 07:10 schrieb Ivo Bellin Salarin <
>> [email protected]>:
>>
>>
>> > Q: How is the <select/> markup being generated?
>> line 48 of https://github.com/jenkinsci/jenkins/blob/master/core/src/
>> main/resources/lib/form/select.jelly:
>> ${descriptor.calcFillSettings(field,attrs)} <!-- this figures out the
>> 'fillUrl' and 'fillDependsOn' attribute -->
>>
>> line 394 of https://github.com/jenkinsci/jenkins/blob/
>> 4e0af4319ce8d7efc2bf6af313d5e154066b6dee/core/src/main/java/
>> hudson/model/Descriptor.java
>> public void calcFillSettings(String field, Map<String,Object> attributes)
>> [..]
>> if(method==null) throw new IllegalStateException(String.format("%s
>> doesn't have the %s method for filling a drop-down list", getClass(),
>> methodName));
>>
>> Q: is my descriptor known to the jenkins instance?
>> During the debug of one of the static methods, I can get one record for
>> jenkins.model.Jenkins.getInstance().<MyRootAction,
>> Descriptor<MyRootAction>>getDescriptorList(MyRootAction.class)
>> So, the descriptor should be visible to the instance.
>> The call to
>> jenkins.model.Jenkins.getInstance().<MyRootAction,
>> Descriptor<MyRootAction>>getDescriptorList(MyRootAction.class).get(
>> MyRootAction.DescriptorImpl.class)
>> confirms that this instance is the one returned by my descriptor.
>>
>> Q: where has my descriptor passed?
>>
>>
>> Le Tue Feb 10 2015 at 14:05:49, Ivo Bellin Salarin <
>> [email protected]> a écrit :
>>
>>> Thanks again, Ulli.
>>>
>>> I've reworked my code, and its rather essential right now. My class
>>> (MyRootAction) extends AbstractDescribableImpl and it show a nested static
>>> public class implementing Descriptor<MyRootAction>. This nested class has
>>> been decorated with @Extension, as MyRootAction is. (
>>> https://github.com/nilleb/jenkins-plugins/blob/master/
>>> rootaction-example-plugin/src/main/java/org/jenkinsci/plugins/
>>> rootactionexampleplugin/MyRootAction.java
>>> )
>>>
>>> But, the combobox is still not filled with my values. The reason is
>>> always the same: my <select/> is as follows: <select name="_.goalType"
>>> class="setting-input  select " value=""></select> => the attribute @fillUrl
>>> is missing.
>>>
>>> The ui-samples, at run-time, have a fillUrl for their <select/>:
>>> <select fillurl="/jenkins/descriptorByName/jenkins.plugins.ui_samples.
>>> DynamicDropDownListBox/fillStateItems" filldependson="country"
>>> name="_.state" class="setting-input  select " value="USA:B"><option
>>> value="USA:A">State A in USA</option><option value="USA:B">State B in
>>> USA</option><option value="USA:C">State C in USA</option></select>
>>>
>>> Q: How is the <select/> markup being generated?
>>>
>>>
>>> Le Tue Feb 10 2015 at 12:03:48 PM, Ulli Hafner <[email protected]>
>>> a écrit :
>>>
>>> You should not create a new descriptor on every call to getDescriptor,
>>>> this is done by Jenkins! So no need to override getDescriptor().
>>>>
>>>> Best thing is to extend from AbstractDescribableImpl.
>>>>
>>>> Am 09.02.2015 um 21:54 schrieb Ivo Bellin Salarin <
>>>> [email protected]>:
>>>>
>>>> Thanks Ulli!
>>>>  Yet I have to figure why the prototype.js is asking for null:
>>>> <html><body>
>>>> <h1>404 Not Found</h1>
>>>> <p>Stapler processed this HTTP request as follows, but couldn't find
>>>> the resource to consume the request
>>>> <pre>
>>>> -> evaluate(&lt;hudson.model.Hudson@6a4edb79> :hudson.model.Hudson,"/
>>>> MyRootAction/null")
>>>> -> evaluate(((StaplerProxy)&lt;hudson.model.Hudson@6a4edb79>).
>>>> getTarget(),"/MyRootAction/null")
>>>> -> evaluate(&lt;hudson.model.Hudson@6a4edb79>.getDynamic("MyRoo
>>>> tAction",...),"/null")
>>>> -> evaluate(&lt;org.jenkinsci.plugins.rootactionexampleplugin.M
>>>> yRootAction@974f250> :org.jenkinsci.plugins.rootactionexampleplugin.
>>>> MyRootAction,"/null")
>>>> <font color=red>-&gt; No matching rule was found on
>>>> &lt;org.jenkinsci.plugins.rootactionexampleplugin.MyRootAction@974f250&gt;
>>>> for "/null"</font>
>>>> </pre>
>>>> <p>&lt;org.jenkinsci.plugins.rootactionexampleplugin.MyRootA
>>>> ction@974f250&gt; has the following URL mappings, in the order of
>>>> preference:<ol>
>>>> <li>
>>>> TOKEN.groovy for url=/TOKEN
>>>> <li>
>>>> VIEW.jelly for url=/VIEW
>>>> <li>
>>>> org.jenkinsci.plugins.rootactionexampleplugin.MyRootAction.getDescriptor()
>>>> for url=/descriptor/...
>>>> <li>
>>>> org.jenkinsci.plugins.rootactionexampleplugin.MyRootAction.getDisplayName()
>>>> for url=/displayName/...
>>>> <li>
>>>> org.jenkinsci.plugins.rootactionexampleplugin.MyRootAction.getIconFileName()
>>>> for url=/iconFileName/...
>>>> <li>
>>>> org.jenkinsci.plugins.rootactionexampleplugin.MyRootAction.getUrlName()
>>>> for url=/urlName/...
>>>> <li>
>>>> org.jenkinsci.plugins.rootactionexampleplugin.MyRootAction.getBuildGoals()
>>>> for url=/buildGoals/...
>>>> <li>
>>>> java.lang.Object.getClass() for url=/class/...
>>>> </ol>
>>>> </body></html>
>>>>
>>>> The code which generates this request is on github (
>>>> https://github.com/nilleb/jenkins-plugins/tree/master/roota
>>>> ction-example-plugin).
>>>>
>>>> Tomorrow, maybe.
>>>>
>>>> Thanks, have a good evening.
>>>>
>>>> Il giorno lun 9 feb 2015 20:00 Ulli Hafner <[email protected]>
>>>> ha scritto:
>>>>
>>>> https://wiki.jenkins-ci.org/display/JENKINS/Figuring+out+URL
>>>>> +binding+of+Stapler
>>>>>
>>>>> Am 09.02.2015 um 17:11 schrieb Ivo Bellin Salarin <
>>>>> [email protected]>:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I can't figure out why my doFillXXXItems aren't being called.
>>>>>
>>>>> Is there some way to log/debug jelly<-->Descriptor interactions?
>>>>>
>>>>> Thanks in advance,
>>>>> Ivo
>>>>>
>>>>> --
>>>>> 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/CAPc4eF_3ZaTwMJWPK_--s1fLViFEm5YY0o8UfcfF%
>>>>> 3D5YhmRRkNQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF_3ZaTwMJWPK_--s1fLViFEm5YY0o8UfcfF%3D5YhmRRkNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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/1F5EA278-2094-4225-AB32-3A575D9BD61E%40gmail.com
>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/1F5EA278-2094-4225-AB32-3A575D9BD61E%40gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>>> 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/ms
>>>> gid/jenkinsci-dev/CAPc4eF-bZx%3Dn78N3QzrXO5-DiPM4Hh08A5srFnV
>>>> BCB-MgGxT5Q%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF-bZx%3Dn78N3QzrXO5-DiPM4Hh08A5srFnVBCB-MgGxT5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>> --
>>>> 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/ms
>>>> gid/jenkinsci-dev/B5F356C5-65F7-4155-9DAA-AD4A7FD12A50%40gmail.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/B5F356C5-65F7-4155-9DAA-AD4A7FD12A50%40gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>> --
>> 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/CAPc4eF_g1dW%2BAgyiJOfAFr7-
>> S4S1Bm6J6UF7%3Dk8JhYvFLrujjA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF_g1dW%2BAgyiJOfAFr7-S4S1Bm6J6UF7%3Dk8JhYvFLrujjA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>  --
>> 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/7F285FFB-D683-4664-8A9D-9A39C20CDF24%40gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/7F285FFB-D683-4664-8A9D-9A39C20CDF24%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/CAPc4eF8FyWJb%2BNkCXm-LphCnWZQhyjz0ZW-wzQg%3Dry-K%2BH3fHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to