How do I have a disabled entry in a Jelly form

71 views
Skip to first unread message

Marc Carter

unread,
Jun 10, 2016, 7:27:32 AM6/10/16
to Jenkins Developers
Hi
I think the subject says it all but to expand: I wish to conditionally show some f:entry/f:checkbox elements as greyed-out (ideally with a suitable tooltip) rather than simply not displaying them. Is this not possible?

Tom Fennelly

unread,
Jun 13, 2016, 8:53:43 PM6/13/16
to Jenkins Developers
I guess it depends on how you want to eventually reenable the elements on the page, but in general you're talking about using JavaScript on the page that watches the values change in certain fields and then enables/disables the "special" fields.

Marc Carter

unread,
Jun 15, 2016, 3:38:37 AM6/15/16
to Jenkins Developers
I'm not looking for "dynamic" as in realtime changes, page-load is fine. Enablement is based on installation/use of other plugins. Here's what I've got together now as a workaround:

<f:entry title="${e.id}">
<j:choose>
<j:when test="${e.disabledText != null}">
<label tooltip="${%Not applicable}: ${e.disabledText}">
<input type="checkbox" disabled="disabled"/>
${e.description}
</label>
</j:when>
<j:otherwise>
<f:checkbox title="${e.description}" name="exclusions" default="${instance.exclusions.contains(e.id)}"
json="${e.id}"/>
</j:otherwise>
</j:choose>
</f:entry>

Reply all
Reply to author
Forward
0 new messages