4 Replies Latest reply on Oct 16, 2009 7:04 PM by sburgula1

    rich:datatable rows to be links

      I would like to know how to display the rows of datatable, as hyperlinks to backing bean. the whole row should be a hyperlink and when clicked should invoke the backing bean.  I have 4 column (i.e rich:column) within the rich:datatable.


      Please let me know if anyone has a solution.



      thanks
      Sai

        • 1. Re: rich:datatable rows to be links
          xsalefter.xsalefter.yahoo.com

          Hi.. You can follow this topic.


          Hope thats help.

          • 2. Re: rich:datatable rows to be links

            Thanks for your help.  But that uses rich:extendedDataTable.  And I am using rich:dataTable and the functions available in each to read a single row clicked are different.  Infact rich:dataTable does not have a function to read a selected row.  The other one does.  Kindly let me know if you came across any implementation which uses rich:dataTable, where dataTable, is of javax.faces.component.html rather than richfaces.

            • 3. Re: rich:datatable rows to be links
              xsalefter.xsalefter.yahoo.com

              Well, yes. Unfortunatelly rich:dataTable and h:dataTable doesn't have.


              But, except you have strict requirement that doesn't allow you use a rich:extendedDataTable, I think the simple solution is to use it.


              Uhm, sorry. I never try what you mean and have no solution for you.

              • 4. Re: rich:datatable rows to be links
                I found that the table could be made linkable by inserting the following code within rich:dataTable.

                <a4j:support action="#{courseSearch.loadCourseOffering()}" event="onRowClick"
                                  reRender="searchResults">
                                                                
                         <f:setPropertyActionListener value="#{var}"
                                 target="#{courseSearch.selectedCourse}" />
                                 <s:conversationPropagation
                          type="join"/>                                                 </a4j:support>


                Although what happens is that when it loads the next page, I have two links to be displayed on the top of the page. 

                <h:panelGrid columns="2" cellpadding="5" cellspacing="5">
                                 s:link value="Edit Record | "
                              rendered="#{s:hasPermission('crs_search','edit','')}"
                              action="#{courseSearch.update()}" >
                           <s:conversationPropagation type="none"/>
                           </s:link>

                          <s:link value="Delete Record" align="right"
                                rendered="#{s:hasPermission('crs_search','edit','')}"
                              action="#{courseSearch.confirmDelete()}" >
                              <s:conversationPropagation type="none"/>
                          </s:link>
                </h:panelGrid>


                the problem is that the edit link does not work, the page which displays the details vanishes.  And when I examine whether it has reached the backing bean, it definitely has, but does not render the response view.

                If anyone has a implementation using a4j:support with rich:dataTable and s:link please get back to me as soon as possible.  Any information on this is definitely useful and helpful.

                thanks
                Sai