The selected attribute just needs to be present to select a <select>.
That is, only the item you wish to have selected by default must have
the selected attribute.

On Fri, Jun 22, 2012 at 3:29 PM, Peter Gottinger <[email protected]> wrote:
> Hi,
>
> I am trying to build a select box for a plugin. My config.jelly looks like
> this:
>
>>
>> ...
>>
>> <f:entry name="display" title="Display" field="display">
>>     <select name="portlet.display">
>>         <option selected="${if (instance.getDisplay().compareTo('ALL')==0)
>> true; else false;}" value="ALL">
>>             All tests
>>         </option>
>>         <option selected="${if
>> (instance.getDisplay().compareTo('SUCCESS')==0) true; else false;}"
>> value="SUCCESS" >
>>             Only successful tests
>>         </option>
>>         <option selected="${if
>> (instance.getDisplay().compareTo('FAILED')==0) true; else false;}"
>> value="FAILED">
>>             Only failed tests
>>         </option>
>>         <option selected="${if
>> (instance.getDisplay().compareTo('SKIPPED')==0) true; else false;}"
>> value="SKIPPED">
>>             Only skipped tests
>>         </option>
>>     </select>
>>   </f:entry>
>>
>> ...
>
>
> When I run this in Jenkins, I can see in the HTML output, that the correct
> option is marked as selected = "true" but the last entry (in this case the
> "skipped"-entry) is always the visible element in the configuration screen.
>
> So I am generating the correct HTML output but the visible output is
> different. Anyone has some experience with this?
>
> Best regards,
> Peter

Reply via email to