Hiding a UI Checkbox in Jelly

Mike Hill1
Giga Contributor

I am working on a UI Action that copies a record.   Part of the process is to prompt the user if they want to include related records, in this case Outages.   I have an IF statement built and working, but having trouble finding the right code to hide the ui_checkbox in the first case.

<j:if test="${!jvar_gr.hasNext()}">

        <p>

        <g:ui_checkbox name="attachments" id="attachments" value="false"/>        

        <label>Attachments</label>

        </p>

</j:if>

<j:if test="${jvar_gr.next()}">

        <p>

        <g:ui_checkbox name="attachments" id="attachments" value="true"/>

        <label>Attachments</label>

        </p>

</j:if>

For line 3 - is there a tag/label I can add that makes the ui_checkbox hidden?   It is setting the value correctly to true or false, but I want it to be completely hidden on false.   Can't just omit it because I need to call it in the Processing Script, but I don't want the user to see it either.

I tried [display="false"] & [visible="false"] & [visibility="false"] but no luck.   Appreciate any help you can provide!

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

<j:if test="${!jvar_gr.hasNext()}">  


        <p style="display:none">  


        <g:ui_checkbox name="attachments" id="attachments" value="false"/>            


        <label>Attachments</label>  


        </p>  


</j:if>  


 


<j:if test="${jvar_gr.next()}">  


        <p   style="display:block">  


        <g:ui_checkbox name="attachments" id="attachments" value="true"/>    


        <label>Attachments</label>  


        </p>  


</j:if>  


View solution in original post

5 REPLIES 5

Glad you got it working.