During a creation of a new Jenkins plugin I have a requirement to allow config.jelly dynamically add entries. The Builder class will call Rest API and get as a result field name and type. it is unlimited list of fields than can be 0 or even 20 fields, all is according to the Rest API results. for the simplicity of the question lets say the field types are limited to textbox and select only.
The rest API is already implemented, but as for the config.jelly I have no clue what to do.
For example: the rest API returns:
<arguments>
<argument>
<name>handsetId</name>
<type>textbox<type>
</argument>
</arguments>
So jelly code should be something like:
<f:entry title="handsetId" field="handsetId">
<f:textbox />
</f:entry>
and if the rest API returns:
<arguments>
<argument>
<name>handsetId</name>
<type>textbox<type>
</argument>
<argument>
<name>ticketNo</name>
<type>textbox<type>
</argument>
<argument>
<name>phonelist</name>
<type>dddw<type>
</argument>
</arguments>
Then jelly code should be something like:
<f:entry title="handsetId" field="handsetId">
<f:textbox />
</f:entry>
<f:entry title="ticketNo" field="ticketNo">
<f:textbox />
</f:entry>
<f:entry field="phonelist" title="phonelist">
<f:select />
</f:entry>