4 Replies Latest reply on Nov 8, 2007 4:58 AM by Ilya Shaikovsky

    table row selection in ModalPanel is nonresposive

    Martin Jozef Newbie

      The overall problem is as follows:

      I have a create Customer page
      on this page i have to pick an Agent out of a datatable list.
      This list is shown on a ModalPanel with the ability to search by last name.
      the search button fires an action as a ajax requests and rerenders the table
      once the table is populated i have a commandLink on each row for agents ID
      I click on the link and nothing happens, my action and action listener does not fire.

      here is my Modal Panel setup :

       <rich:modalPanel id="mp" minHeight="330" minWidth="550" height="330" width="550" zindex="2000" >
       <f:facet name="header">
       <h:outputText value="Select Agent" />
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/images/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
       </f:facet>
       <h:form id="mf1" >
       <h:panelGrid columns="3">
       <h:outputText value="Last Name:" />
       <h:inputText value="#{customerRenderer.agentSearchName}" />
       <a4j:commandButton value="Search" reRender="agentModalTable" action="#{customerRenderer.searchAgent}"/>
       </h:panelGrid>
       </h:form>
       <h:form id="mf2" >
       <rich:dataTable width="523" id="agentModalTable" rows="10" value="#{agentListBySearch}" var="tableRowValue1"
       columnsWidth="20%,10%,50%,20%"
       onRowMouseOver="this.style.backgroundColor='#B5CEFD'"
       onRowMouseOut="this.style.backgroundColor='#{org.richfaces.SKIN.tableBackgroundColor}'" >
      
       <h:column>
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Agent" />
       </f:facet>
       <h:outputText value="#{tableRowValue1}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Lisence" />
       </f:facet>
       <h:outputText value="#{tableRowValue1.license}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Agency" />
       </f:facet>
       <h:outputText value="#{tableRowValue1.agencyName}" />
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Agent ID" />
       </f:facet>
      
       <a4j:commandLink immediate="true" reRender="mp" actionListener="#{customerRenderer.selectedAgentEvent}" value="#{tableRowValue1.insagentid}">
       <f:setPropertyActionListener value="#{tableRowValue1}" target="#{selectedAgent}" />
       </a4j:commandLink>
      
       </h:column>
      
       <f:facet name="footer">
       <rich:datascroller pageIndexVar="pageIndex" pagesVar="pages">
       <f:facet name="pages">
       <h:outputText value="#{pageIndex} / #{pages}"></h:outputText>
       </f:facet>
       </rich:datascroller>
       </f:facet>
      
       </rich:dataTable>
       </h:form>
      
       </rich:modalPanel>
      
      


      I am trying to update my customer bean with the selected agent id
      i tried many things, all kinds of combinations, commandButton, commandLink, HtmlCommandLink, a4j:support, a4j:actionParam

      Why is the functionality of selecting a specific row in a table so darn difficult. Is there another standard way of selecting a row ?

      I was trying to find some good example of TableModel backed bean but no luck. Does anyone have a worked out solution that can share with us. I would be most greatfull to have this resolved once and for all.