3 Replies Latest reply on Dec 8, 2009 8:57 AM by swrich

    Is it possible to enable/disable a tab from a checkbox on th

      It probably is ...

      We have a collection of categories read from a table. Each category is represented by a checkbox and a tab page.
      When a checkbox is 'checked' (true) the corresponding tab should be enabled, when the checkbox is 'unchecked' (false) the corresponding tab should be disabled.

      Is there a way to do this at the client side, for example using some a4j tag or rich:JQuery ?

      Code we have sofar:

      <h:form styleClass="form" id="theForm">
      
       ... other content ...
      
       <h:selectManyCheckbox disabledClass="selectManyCheckbox_Disabled" styleClass="selectManyCheckbox" id="checkbox1" layout="pageDirection" value="#{projectBean.select}">
       <f:selectItems value="#{projectBean.categories.categories}" />
       </h:selectManyCheckbox>
      
       <rich:tabPanel id="tabs" switchType="client" >
       <c:forEach items="#{projectBean.categories.categories}" var="category">
       <rich:tab >
       <f:facet name="label" >
       <h:outputText value="#{category.label}" />
       </f:facet>
       <table>
       ... content ...
       </table>
       </rich:tab>
       </c:forEach>
       </rich:tabPanel>
       <p/>
       <h:commandButton style="float:right;" type="submit" value="#{msg.actionCancel}" label="#{msg.actionCancel}" styleClass="commandButton" id="cancelProject" action="#{projectBean.actionCancel}" immediate="true"/>
       <h:commandButton style="float:right;" type="submit" value="#{msg.actionSave}" label="#{msg.actionSave}" styleClass="commandButton" id="saveProject" action="#{projectBean.actionSave}" />
      </h:form>