Hello guys I need some help with a form for the global config.
I'm trying to modify the default config sample plugin and mixing it with the samples of the UI-sample plugin.
so finaly I can create my own configuration for my plugin.
but I'm really strugling.
This is the Jelly file.
-----------
file name: config.jelly
in package: io.jenkins.plugins.sample.SampleConfiguration
---------------
<?xml version="1.0" encoding="UTF-8"?>
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/samples">
<f:section title="${%01Test Form}">
<f:entry field="label" title="${%Label}">
<f:textbox/>
</f:entry>
<j:set var="currentFruit" value="${it.fruit}" defaultValue="noneRamone"/>
<f:block>Esta es mi current Fruit "${currentFruit.displayName}"</f:block>
<f:dropdownList name="fruit" title="Fruits">
<j:forEach var="descriptor" items="${it.fruitDescriptors()}" varStatus="loop">
<j:set var="fruit" value="${descriptor==currentFruit.descriptor?currentFruit:null}"/>
<f:dropdownListBlock title="${descriptor.displayName}" value="${loop.index}"
selected="${fruit!=null}" staplerClass="${
descriptor.clazz.name}">
<st:include page="${descriptor.configPage}" class="${descriptor.clazz}"/>
</f:dropdownListBlock>
</j:forEach>
</f:dropdownList>
</f:section>
</j:jelly>
-----------------
The thing is for the textbox label it get the information from the Java class right.
but for the j:set current Fruit I gues it should execute the method get Fruit() from the same class but it does not.
I have traces and the method is never executed.
I'm lost no idea what I'm doing wrong
I guess the same is happening for the j:forEach to fullfill all the options inthe dropdown list.
any ideas?
I must admit I have verry little jelly knowledge and I'm also struging to find documentation that helps with this.
Thanks for your help.