0 Replies Latest reply on Oct 20, 2009 10:41 AM by Louis Parisi

    Trouble rerendering master table in master detail table layo

    Louis Parisi Newbie

      I have two rich:datatables: orderMasterTable and orderDetailTable. For the first column of the master table I have a name and it is either rendered with an a4j:commandLink or h:outputText depending on if it is the currently selected row. If it is the currently selected row it is h:outputText and if not selected row then a4j:commandLink so that the row can be selected.

      When the a4j:commandLink is clicked it selects the current item and rerenders the detail table with the details of the selected item. This part works.

      The problem I have is that I also need to rerender the master table so that the newly selected row is rendered with h:outputText and all other rows are a4j:commandLink. If I only have rerender="orderDetailTable" the detail table is rerendered ok but the link rendering of the master table is not updated. If I put rerender="orderDetailTable, orderMasterTable" then neither table rerenders.

      Any help is appeciated.

      Here is the code:

       <h:form>
       <!-- master table -->
       <rich:dataTable id="orderMasterTable"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       value="#{orderTable.orderList}" var="orderItem"
       width="600px" ajaxKeys="#{orderTable.keysToUpdate}">>
      
       <h:column id="deviceColumn">
       <f:facet name="header">
       <f:verbatim>Device</f:verbatim>
       </f:facet>
       <h:outputText id="device" value="#{orderItem.device}"
       rendered="#{orderItem.device==orderTable.selectedOrder.device}"/>
      
       <a4j:commandLink id="deviceLink" value="#{orderItem.device}"
       reRender="orderDetailTable, orderMasterTable" rendered="#{orderItem.device!=orderTable.selectedOrder.device}">
       <f:setPropertyActionListener value="#{orderItem}"
       target="#{orderTable.selectedOrder}"/>
       </a4j:commandLink>
       </h:column>
       .... more columns ....
       </rich:dataTable>
      
       <!-- detail table -->
       <rich:dataTable id="orderDetailTable"
       value="#{orderTable.selectedOrder.details}" var="orderDetail"
       width="600px">
       <h:column>
       <f:facet name="header">
       <f:verbatim>Submit Order</f:verbatim>
       </f:facet>
       </h:column>
       .... more columns ....
       </rich:dataTable>