How do I invoke java method with parameters from jelly page?

12 views
Skip to first unread message

司芳源

unread,
Dec 3, 2017, 5:15:23 AM12/3/17
to Jenkins Developers
I'm developing a builder plugin. In my config.jelly, I have en entry which depends on the value selected in other entry, for example:

<f:entry title="Select" field="select">
 
<f:select/>
</f:entry>
<j:if test="${descriptor.testMethod(--the parameter should be the value selected in above entry--)}">
 
<f:entry title="Test" field="test">
 
<f:textbox/>
 
</f:entry>
</j:if>

I tried to do the same as dynamic dropdownlist in ui-examples, annotate the argument of descriptor's testMethod with @QueryParameter, but it doesn't work.
Is there a way to do that?

司芳源

unread,
Dec 4, 2017, 3:17:27 AM12/4/17
to Jenkins Developers
I managed to achieve this with a differenct approach, the same as dropdownlist in ui-examples. I put related configs in different dropdownlistblocks, each related to a descriptor. I inject all possible descriptors into jenkins, and in the dropdownlist's getDescriptors method, I return the descriptors selectively.
Reply all
Reply to author
Forward
0 new messages