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

    table row selection in ModalPanel is nonresposive

    martinjozef

      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.

        • 1. Re: table row selection in ModalPanel is nonresposive

          We have similar functionality on a ScrollableDataTable (not in a Modal Panal) where we track the currentRow selected via

          <a4j:support event="onRowClick" actionListener="#{userSecurityAction.rowSelected}" reRender="objectDetail, editObjectForm, deleteObjectForm, userRoleList, userGroupList" />
          


          That may help.

          Whatty

          • 2. Re: table row selection in ModalPanel is nonresposive
            martinjozef

            actually i used firebug do track the communication.
            and when i click on

            <a4j:commandLink reRender="ajaxRegion1" actionListener="#{customerRenderer.selectedAgentEvent}" value="#{tableRowValue1.insagentid}">
             <a4j:actionparam name="selecteAgentParam" value="12333" assignTo="#{customer.lastName}"/>
             <!-- <f:setPropertyActionListener value="#{tableRowValue1}" target="#{selectedAgent}" /> -->
             </a4j:commandLink>
            
            


            i can see that the ajax request was fired but my action listener is not invoked at all. I have the server running in debug mode and my action listener method contains breakpoints.
            if it fired i would be able to check if actionParam tag did it's job and set the value 12333 into customer.lastName property. but i can't even get there
            the actionListener binding does not inoke my method.



            • 3. Re: table row selection in ModalPanel is nonresposive
              lsabin

              Hi.

              I have the same issue. I have noticed that if the a:commandLink is not inside a dataTable the action is triggered.

              Anyone could give some help?

              Thanks.

              • 4. Re: table row selection in ModalPanel is nonresposive
                ilya_shaikovsky

                Use phase tracker to check the hase where the request breaks.