0 Replies Latest reply on Dec 11, 2009 9:35 PM by sai burgula

    How to make rich datatable editable and have a link displayed by each row

    sai burgula Novice
      Hi

      I have a rich:dataTable.  I would like to be able to click on any row and at the same time display a link at each end of the row to display the row contents.


      Heres the code that I have at this point.


      <rich:dataTable id="coreGrpResTab" value="#{adminSearch.coreGroupList}" var="coreGrp"
                                                                                                         rows="25" sortMode="single"
                                                                                                      onRowMouseOver="this.style.backgroundColor='#FFFFAA'"
                                             
               onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
                                                                                                       <a4j:support action="#{adminSearch.loadCoreGroupCourse()}" event="onRowClick"
                reRender="searchForm" >
                                                                                                                  <f:setPropertyActionListener value="#{coreGrp}"
                               target="#{adminSearch.selectedCoreGrp}" />
                     <s:conversationPropagation type="join"/>
                </a4j:support>
                                                                                                                     
                                                                                                                                                                      
                                                                                                                  <rich:column>
                                                                                                                      <f:facet name="header">
                                                                                                                              <h:outputText value="Degree Program" />
                                                                                                                      </f:facet>
                                                                                                                      <h:outputText value="#{coreGrp.degreeProgram}" />
                                                                                                                     
                                                                                                              </rich:column>
                                                                                                              <rich:column>
                                                                                                                      <f:facet name="header">
                                                                                                                              <h:outputText value="Begin Semester" />
                                                                                                                      </f:facet>
                                                                                                                      <h:outputText value="#{coreGrp.beginSem}" />
                                                                                                              </rich:column>
                                                                                                              <rich:column>
                                                                                                                      <f:facet name="header">
                                                                                                                              <h:outputText value="End Semester" />
                                                                                                                      </f:facet>
                                                                                                                      <h:outputText value="#{coreGrp.endSem}" />
                                                                                                              </rich:column>   
                                                                                                               <rich:column>
                                                                                                              <s:link value="Select"       action="#{adminSearch.viewCoreGroup()}">
                          <f:setPropertyActionListener target="#{adminSearch.selectedCoreGrp}"
                              value="#{coreGrp}" />
                               <s:conversationPropagation type="join"/>
                      </s:link>
                                                                                                              </rich:column>                                           
               </rich:dataTable>




      Here is the problem with this.  First of all I am able to click on each row.  That is not a problem.  But I am not able to hit Select and display the contents every time.  Sometimes the data does get displayed.  The other times it just renders a empty form.

      I think there is a problem with using s:link.  Is there a better way to display a link by each row of the datatable.

      Kindly do let me know.

      thanks
      Sai

      =

      `

      ``

      `