0 Replies Latest reply on Apr 19, 2012 1:03 PM by ayoubtunu

    Help : how to transfer data from a rich:datatable row to a managed bean after a rowdblclick

    ayoubtunu

      Hi every body,

       

      I was looking a long time ago for somebody who had an experience on richfaces4 components especially in rich:datatable and it's related attributes and events. i'm really disturbed and tired from searching on the internet without any satisfying result.

      Well, I want to get data from a rich:datatable row after it's been clicked twice and send it to a managed bean to display it on another JSF screen (like an screen details).

      Here's the my source code :

       

      <a4j:jsFunction name="showRowDetails" >

                              <a4j:param name="rowKey" assignTo="#{currencyBean.showRowDetails}" />

      </a4j:jsFunction>

       

      <rich:dataScroller for="table" maxPages="10" renderIfSinglePage="false"/>      

      <rich:dataTable value="#{currencyBean.listeCurrency}" var="carrency" id="table" rows="11" rowClasses="row1,row2" onRowDblClick="showRowDetails({carrency.currency_code})">

        <h:column>

                                                        <f:facet name="header">

                                                            <h:outputText>Currency code</h:outputText>

                                                        </f:facet>

                                                        <h:outputText value="#{carrency.currency_code}"></h:outputText>

                                                  </h:column>

       

                                                  <h:column>

                                                        <f:facet name="header">

                                                            <h:outputText>Abreviation</h:outputText>

                                                        </f:facet>

                                                        <h:outputText value="#{carrency.currency_code_alpha}"></h:outputText>

                                                  </h:column>

       

                                                  <h:column>

                                                        <f:facet name="header">

                                                            <h:outputText>Wording</h:outputText>

                                                        </f:facet>

                                                        <h:outputText value="#{carrency.currency_name}"></h:outputText>

                                                  </h:column>

       

      </rich:dataTable>    

      <rich:dataScroller for="table" maxPages="10" />

       

      Here's my ManagedBean's method "currencyBean.showRowDetails" :

       


      public String showRowDetails(String codeCurrency)

      {


      currency_tableService = SpringUtil.getCurrencyService();


      try {



      listeCurrency = currency_tableService.searchCurrency_tableService(





      ServiceContextStore.get(), this.getCurrencyTable());


      } catch (Exception e) {



      e.printStackTrace();


      }


      this.getCurrencyTable().setCurrency_code(null);


      return "show_row_details";

      }

       

      When i deploy my projet in tomcat7 server and i run the browser every thing work as expected despite the rowdblclick event which give nothing !!

       

      I still waiting for ur replies, help me pleaaase Many thanks in advance.