4 Replies Latest reply on Jul 25, 2012 3:34 PM by pavna

    lazy load the subtable - richfaces 4.0

    pavna

      Hi , I am using collapsibleSubTableToggler tag and I have a rich:tree in my subtable. Work great but the performance is horrible especially in IE 7. Is there as way to do a lazy load for collapsible sub table ?

      Any help is truly appreciated.

      Thanks

      Pavna

       

            <rich:column width="5px" >             

                       <f:facet name="header">

                          <h:outputText value="Action" style="font-size:10px;"/>

                      </f:facet>

                

                         <rich:collapsibleSubTableToggler for="sbtable"           width="9px" event="onclick"/>

       

                           </rich:column>

                   

      <rich:collapsibleSubTable id = "sbtable" var="subTable" value="#{searchBean.aplSearchMap[wo.wonumber]}"

                                             expandMode="client" expanded="#{false}"  colspan="14" >

                                             <rich:column colspan="2" breakRowBefore="true"></rich:column>

                                <rich:column colspan="10" styleClass="textOnRight" >

                                                                  <f:facet name="header" style="text-align:left;" >Detail Work Order</f:facet>

       

                                                                            <div>

       

                                                                            <rich:tree id="treeWOtest1" value="#{searchBean.treeMap[wo.wonumber]}" var="elem"

                                                                      selectionType="ajax" toggleNodeEvent="click"  toggleType="client"

                                                                     selectionChangeListener="#{searchBean.selectionChanged}"

                                                                      render="wodataID" styleClass="scroll2"

                                                                      ondblclick="window.open('../pages/authenticateToVE.jsf?mdc=mdc','_parent'); return false;">

                                                

                                                                       <rich:treeNode expanded="#{true}" selectedClass="test" >

                                                                                 <h:outputText id="wotreeheader" style="font-weight:bold;text-align:left;float:left;"

                                                                                                               value="#{elem.workorder.id.baseId} - #{elem.workorder.id.subId} / #{elem.workorder.id.lotId}.#{elem.workorder.id.splitId}" 

                                                                                                               rendered="#{elem.type == 'WORKORDER'}"/>

                                                                                 <rich:tooltip mode="ajax" target="wotreeheader" followMouse="true">

                                                                                                <h:panelGroup style="width:200px">

                                                                                                Work Order Leg, sub ID=   #{elem.workorder.id.subId} 

                                                                                                </h:panelGroup>

                                                                                      </rich:tooltip>

                                                                                    <h:panelGrid columns="2"  style="text-align:left;" border="" >   

                                                                                              <rich:progressBar  value="#{elem.pcCompleted}" rendered="#{elem.type == 'OPERATION'}">

                                                                                   <h:outputText value="#{elem.pcCompleted} %" ></h:outputText>

                                                                  </rich:progressBar>  

                                                                        <h:outputText  style="color:green;text-align:left;float:left;"  id="optreeheader"

                                                                        value="#{elem.operation.id.sequenceNo}  #{elem.operation.operationType.description}    "  rendered="#{elem.type == 'OPERATION'}"/>

                                                                        <h:outputText value="Release (R)" rendered="#{elem.operation.status == 'R'}"  style="color:green;" />

                                                                        <h:outputText value="Firm (F)" rendered="#{elem.operation.status == 'F'}" style="color:green;" />

                                                                        <h:outputText value="Unrelease (U)" rendered="#{elem.operation.status == 'U'}" style="color:green;" />

                                                                        <h:outputText value="Close (C)" rendered="#{elem.operation.status == 'C'}" style="color:green;" />

                                                                        <h:outputText value="Cancel (X)" rendered="#{elem.operation.status == 'X'}" style="color:green;" />

                                                                        <rich:tooltip mode="ajax" target="optreeheader" followMouse="true">

                                                                                                          <h:panelGroup style="width:200px">

                                                                                                          Operation Detail:  #{elem.operation.shopResource.id} [#{elem.operation.operationType.id}] 

                                                                                                          </h:panelGroup>

                                                                                      </rich:tooltip>

                                                                             </h:panelGrid>

                                                                                  

                                                                                  </rich:treeNode>                                                  

                                                                               </rich:tree>

                                                

                                                                            </div>

                                                        </rich:column>      

                         </rich:collapsibleSubTable>

        • 1. Re: lazy load the subtable - richfaces 4.0
          healeyb

          I've not tried it with a collapsibleSubTable but I think the starting point would be to make #{searchBean.aplSearchMap[wo.wonumber]}

          point to something that extends ExtendedDataTable and add a dataScroller. Are you using lazy loading with dataTable or extendedDataTable?

          Whether this is supposed to work is anyones guess, it's probably best to just give it a try.

           

          Regards,

          Brendan.

          • 2. Re: lazy load the subtable - richfaces 4.0
            pavna

            I am using  dataTables. 

            • 3. Re: lazy load the subtable - richfaces 4.0
              healeyb

              I made a typo, I meant extends ExtendedDataModel and this still applies to dataTable.

              • 4. Re: lazy load the subtable - richfaces 4.0
                pavna

                I was able to make it work.I found out I can use toggleListener on collapsibleSubTable

                 

                 

                 

                 

                <rich:collapsibleSubTable id = "sbtable" var="subTable" value= "#{searchBean.aplSearchMap[wo.wonumber]}"

                 

                 

                toggleListener="#{searchBean.checkSub}"

                 

                expanded="#{false}" expandMode="ajax" colspan="14">

                 

                 

                 

                 

                On the bean side

                 

                public void checkSub(CollapsibleSubTableToggleEvent event)
                {
                 
                  if(event.isExpanded())
                   this.setShowSub(true);
                 
                 
                  else
                   this.setShowSub(false);
                }

                 

                then I used a panel

                to show and not show the tree.......

                Thanks

                Pavna