1 Reply Latest reply on Apr 15, 2010 4:40 AM by Ilya Shaikovsky

    checkbox doesn't keep state when used in contextMenu

    Yennick Trevels Newbie

      Hi,

       

      I'm having a problem with using checkboxes inside a contextMenu. When the contextMenu appears I can perfectly select/deselect the checkboxes, but when the contextMenu closes and I reopen it the checkboxes are back to their initial state. What I want is that the checkboxes keep their state when the contextMenu is reopened.

       

      This is the code I used for the contextMenu:

       

      <rich:contextMenu id="inputColumnToggleContextMenu"
           event="onclick" attachTo="inputColumnToggleIcon" submitMode="none" >
           <rich:menuItem value="Input 1" >
                <f:facet name="icon">
                     <h:selectBooleanCheckbox value="true" />
                </f:facet>
           </rich:menuItem>
           <rich:menuItem value="Input 2" >
                <f:facet name="icon">
                     <h:selectBooleanCheckbox value="true" />
                </f:facet>
           </rich:menuItem>
           <rich:menuItem value="Input 3" >
                <f:facet name="icon">
                     <h:selectBooleanCheckbox value="true" />
                </f:facet>
           </rich:menuItem>
      </rich:contextMenu>

       

      <h:graphicImage id="inputColumnToggleIcon" url="/images/application_side_contract.png" >
           <rich:componentControl event="onclick" for="inputColumnToggleContextMenu" operation="show" />
      </h:graphicImage>