3 Replies Latest reply on Jan 5, 2009 5:34 PM by Matthieu Guyonnet-Duluc

    s:link inside datatable and parameter

    Matthieu Guyonnet-Duluc Newbie

      .Hello,


      I try to add an s:link inside a richfaces datatable which opens a new window (or new tab) by calling a action with an object as parameter


      Here's my datatable :




      <rich:column headerClass="caption">
                       <f:facet name="header"></f:facet>
                       <h:commandLink id="lienModifierCompte" target="_blank" 
      rendered="#{dossier.compteExistant}" 
      action="#{consultationCompte.consulterCompte(dossier)}">modifier</h:commandLink>
      
                       <s:link id="lienCréerCompte" 
      rendered="#{!dossier.compteExistant}" 
      action="#{creationCompte.initCreationCompte(dossier)}" value="créer"/>                                
                  </rich:column>




      My search bean as the list as DataModel :


      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("recherchePersonne")
      public class RecherchePersonneBean implements RecherchePersonne {
      
           @EJB
           private DifSF service;
           
           /**
            * Collection résultat
            */
           @DataModel
           private List<Dossier> dossierResultats;
      (...)




      And the bean called by the s:link :



      @Begin
      public void initCreationCompte(Dossier dossier) {
        currentDossierDIF = dossier;          
      }



      The h:commandlink works but the dossier parameter of the s:link is always null. I've seen the booking example and it seems to be the same as my requirement but I can't find my problem. When I execute the booking sample one difference is the href generated, the dataModelSelection argument is missing in the URL generated in my datatable but I don't see where does it come, the bean HotelSearchingAction defined only a DataModel (the search result list) but no dataselectionmodel.


      http://localhost:8080/seam-booking/main.seam?actionMethod=main.xhtml%3A
      hotelBooking.selectHotel%28hot%29&cid=12&dataModelSelection=hot%3Ahotels%5B4%5D



      and mine is :



      http://localhost:8080/dif/resultatRecherche.seam?actionMethod=resultatRecherche.xhtml%3
      AcreationCompte.initCreationCompte%28dossier%29&cid=2
       



      The Dossier class is a POJO from a jar library, it's not a component defined.


      I've seen this thread (http://seamframework.org/Community/ConversationLifecycleQuestion ) with the same problem.