2 Replies Latest reply on Aug 9, 2007 2:20 AM by sharonbn

    2 toggleControl expand in 1 table

    sharonbn

      hello,
      i have a jsf page with 1 table.
      the table has 2 columns that should expand by the same toggleControl.
      i have 2 togglePanels with two different id's (descriptions & conditions) and i've tried to put in the "for" attribute "," but it doesn't work.
      example of what i did:
      <rich:toggleControl for="descriptions,conditions" ....

      thanks.

        • 1. Re: 2 toggleControl expand in 1 table

          Can you show more code from your page?

          • 2. Re: 2 toggleControl expand in 1 table
            sharonbn

            hi,
            sorry for the delay and thanks for replying, here is the code:

            <h:form id="universeForm">


            <rich:datascroller fastControls="fastrewind" id="universetablescroller" for="universes" maxPages="5" actionListener="#{universeView.actionScrollerListner}" binding="#{universeView.tableScroller}" ></rich:datascroller>


            <h:dataTable id="universes" binding="#{universeView.table}" rows="#{universeView.numberOfRowsPerPage}" var="universesList" value="#{universeView.universeList}" styleClass="tables" >
            <h:column headerClass="first_cell">
            <f:facet name="header"></f:facet>


            <rich:toggleControl for="descriptions" onclick="change_collapse('#{universesList.universeId}')">
            <img src="resources/images/general/btn_expend.gif" class="plus_minus" id='btn_<h:outputText value="#{universesList.universeId}"/>'>
            </rich:toggleControl>


            </h:column>
            <h:column headerClass="no_background">
            <f:facet name="header"></f:facet>

            </h:column>
            <h:column >
            <f:facet name="header">
            <h:outputText style="width:50%;">
            <a4j:commandLink value="Name" reRender="universes" style="float:left;text-decoration: none;" id="streamName" action="#{universeView.doSort}" actionListener="#{universeView.sortListener}"/>


            <h:outputText rendered="#{universeView.orderby=='streamName'}">
            <h:outputText rendered="#{universeView.direction==0}">

            </h:outputText>
            <h:outputText rendered="#{universeView.direction==1}">

            </h:outputText>
            </h:outputText>

            </h:outputText>
            </f:facet>
            <h:outputText value="#{universesList.streamName}"></h:outputText>
            </h:column>
            <h:column>
            <f:facet name="header">
            <h:outputText>
            <a4j:commandLink value="Description" reRender="universes" style="float:left;" id="description" action="#{universeView.doSort}" actionListener="#{universeView.sortListener}"/>


            <h:outputText rendered="#{universeView.orderby=='description'}">
            <h:outputText rendered="#{universeView.direction==0}">

            </h:outputText>
            <h:outputText rendered="#{universeView.direction==1}">

            </h:outputText>
            </h:outputText>

            </h:outputText>
            </f:facet>


            <rich:togglePanel id="descriptions" switchType="client" stateOrder="regular,expanded">
            <f:facet name="regular" >
            <h:panelGrid columns="1">
            <h:outputText value="#{universesList.shortDescriptionVersion}" escape="false"></h:outputText>
            </h:panelGrid>
            </f:facet>
            <f:facet name="expanded">
            <h:panelGrid columns="1" styleClass="panel_open" >
            <h:outputText value="#{universesList.universeDescription}" escape="false"></h:outputText>
            </h:panelGrid>
            </f:facet>
            </rich:togglePanel>
            </h:column>


            <h:column>
            <f:facet name="header">
            <h:outputText>
            <a4j:commandLink value="Create Date" reRender="universes" style="float:left;" id="createDate" action="#{universeView.doSort}" actionListener="#{universeView.sortListener}"/>


            <h:outputText rendered="#{universeView.orderby=='createDate'}">
            <h:outputText rendered="#{universeView.direction==0}">

            </h:outputText>
            <h:outputText rendered="#{universeView.direction==1}">

            </h:outputText>
            </h:outputText>

            </h:outputText>
            </f:facet>
            <h:outputText value="#{universesList.formatedCreateDate}"></h:outputText>
            </h:column>

            <h:column>
            <f:facet name="header">
            <h:outputText>
            <a4j:commandLink value="Created By" reRender="universes" style="float:left;" id="createdBy" action="#{universeView.doSort}" actionListener="#{universeView.sortListener}"/>


            <h:outputText rendered="#{universeView.orderby=='createdBy'}">
            <h:outputText rendered="#{universeView.direction==0}">

            </h:outputText>
            <h:outputText rendered="#{universeView.direction==1}">

            </h:outputText>
            </h:outputText>

            </h:outputText>
            </f:facet>
            <h:outputText value="#{universesList.createdBy}"></h:outputText>
            </h:column>

            <h:column>
            <f:facet name="header">
            <h:outputText>
            <a4j:commandLink value="Condition" reRender="universes" style="float:left;" id="condition" action="#{universeView.doSort}" actionListener="#{universeView.sortListener}"/>


            <h:outputText rendered="#{universeView.orderby=='condition'}">
            <h:outputText rendered="#{universeView.direction==0}">

            </h:outputText>
            <h:outputText rendered="#{universeView.direction==1}">

            </h:outputText>
            </h:outputText>

            </h:outputText>
            </f:facet>

            <rich:togglePanel id="conditions" switchType="client" stateOrder="regular,expanded">
            <f:facet name="regular" >
            <h:panelGrid columns="1">
            <h:outputText value="#{universesList.shortConditionVersion}" escape="false"></h:outputText>
            </h:panelGrid>
            </f:facet>
            <f:facet name="expanded">
            <h:panelGrid columns="1" styleClass="panel_open">
            <h:outputText value="#{universesList.condition}" escape="false"></h:outputText>
            </h:panelGrid>
            </f:facet>
            </rich:togglePanel>

            </h:column>


            <h:column>
            <f:facet name="header">
            <h:outputText>
            <a4j:commandLink value="Last Campaign" reRender="universes" style="float:left;" id="campaignName" action="#{universeView.doSort}" actionListener="#{universeView.sortListener}"/>


            <h:outputText rendered="#{universeView.orderby=='campaignName'}">
            <h:outputText rendered="#{universeView.direction==0}">

            </h:outputText>
            <h:outputText rendered="#{universeView.direction==1}">

            </h:outputText>
            </h:outputText>

            </h:outputText>
            </f:facet>
            <h:outputText value="#{universesList.campaignName}"></h:outputText>
            </h:column>

            </h:dataTable>
            </h:form>