3 Replies Latest reply on Nov 5, 2008 4:03 AM by Ilya Shaikovsky

    sortBy and rich:column containing h:selectOneMenu

    john hedden Newbie

      selectOneMenu is losing index/position when sorting by another column. its almost like its not sorting like the rest of the table. same thing happens when filtering as well. any suggestions?

      <a:form id="serverInventoryForm">
      
       <a:outputPanel id="messagePanel" ajaxRendered="true">
       <h:messages styleClass="message" globalOnly="true" />
       <rich:spacer height="10"/>
       </a:outputPanel>
      
       <a:outputPanel id="serverInventoryPanel">
       <h:panelGrid columns="1" width="100%" rendered="#{servers.rowCount == 0}">
       <h:outputText value="No Servers" styleClass="message" />
       <rich:spacer height="10"/>
       </h:panelGrid>
      
       <rich:datascroller align="center" for="serverInventory" maxPages="20" rendered="#{servers.rowCount > 0}" />
       <rich:spacer height="20" />
       <rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       value="#{servers}" var="server" id="serverInventory" rows="40"
       rendered="#{servers.rowCount > 0}" width="100%">
       <f:facet name="header">Server Inventory</f:facet>
       <rich:column sortBy="#{server.environment.order.orderNumber}"
       filterBy="#{server.environment.order.orderNumber}" filterEvent="onkeyup">
       <f:facet name="header">Order #</f:facet>
       <h:outputText value="#{server.environment.order.orderNumber}" />
       </rich:column>
       <rich:column>
       <f:facet name="header">Infra. Mgmt.</f:facet>
       <h:outputText id="infraMgmtText" value="#{server.infraManagement.displayName}"
       rendered="#{server.purchaseOrder.getPoNumber() != null ? 'true' : 'false'}">
       </h:outputText>
       <h:selectOneMenu id="infraMgmt" value="#{server.infraManagement}"
       rendered="#{server.purchaseOrder.getPoNumber() == null ? 'true' : 'false'}" required="true">
       <s:convertEnum />
       <s:selectItems value="#{server.infraManagements}" var="enumVar" label="#{enumVar.displayName}"
       noSelectionLabel="Please select.." hideNoSelectionLabel="true" />
       <a:support event="onchange" action="#{serverList.updateServer()}" ajaxSingle="true"
       reRender="serverInventoryPanel, messagePanel"/>
       </h:selectOneMenu>
       </rich:column>
       <rich:column sortBy="#{server.purchaseOrder.poNumber}"
       filterBy="#{server.purchaseOrder.poNumber}" filterEvent="onkeyup">
       <f:facet name="header">P.O. #</f:facet>
       <h:outputText value="#{server.purchaseOrder.poNumber}" />
       </rich:column>
       </rich:dataTable>
       <rich:spacer height="20" />
       <rich:datascroller align="center" for="serverInventory" maxPages="20" rendered="#{servers.rowCount > 0}"/>
       </a:outputPanel>
      
       </a:form>