0

I trying to pass some data from datatable to dialog and then confirm some action. My problem is that passing property to dialog dont works,! dialog appears without data !

Code :

<p:dataTable id="dt" var="cm" value="#{afficherUs.tdata}"  paginator="true"    rows="6"> 
           ....

         <p:column style="width:32px" >
             <p:commandLink   update="display" oncomplete="ChefDialog.show()" >
                 <img src="images/edit.jpg"></img>
       <f:setPropertyActionListener  value="#{cm}" target="#{afficherUs.selectedc}"  />
            </p:commandLink>
         </p:column>

    </p:dataTable>

and the dialog :

<p:dialog header="Detail Compte " widgetVar="ChefDialog" resizable="false"
              width="350" showEffect="explode" hideEffect="explode">
        <p:messages></p:messages>
        <br></br>
        <h:panelGrid id="display" columns="2" cellpadding="2">

            <h:outputText value="Nom:" />
             <p:inplace editor="true" >
                 <p:inputText value="#{afficherUs.selectedc.nom}" required="true" label="text"></p:inputText>
            </p:inplace>


            <h:outputText value="Prenom:" />
             <p:inplace editor="true" >
                 <p:inputText value="#{afficherUs.selectedc.prenom}" required="true" label="text"></p:inputText>
            </p:inplace>
            <h:outputText value="Mot de passe:" />
            <p:inplace editor="true" >
                <p:inputText value="#{afficherUs.selectedc.psw}" required="true" label="text"></p:inputText>
            </p:inplace> 
            <h:outputText value="Role :" /> <p:inplace editor="true" >
                <p:inputText value="#{afficherUs.selectedc.role}" required="true" label="text"></p:inputText>
                                             </p:inplace>

            <h:outputText value=""></h:outputText> <p:panel style="border:none;"> <p:commandButton  value="Valider" action="#{afficherUs.editU}" update="dt msgs" ajax="true"></p:commandButton><p:commandButton  value="Annuler" oncomplete="ChefDialog.hide()"></p:commandButton></p:panel>

        </h:panelGrid>
    </p:dialog>

Thanks

user2420469
  • 91
  • 3
  • 14

1 Answers1

0

Try putting the full id of the display in the update sentence, like this:

<p:commandLink update=":form:display" oncomplete="ChefDialog.show()" >
    ...
</p:commandLink>

Being :form: formed by the id of the form that contains them.

Important: If you have your components within other NamingContainer besides the form, you must also concatenate their ids. Here's an example Naming Container in JSF2/PrimeFaces

Community
  • 1
  • 1
Diego D
  • 1,735
  • 3
  • 22
  • 38
  • Nothing change, the ChefDialog display the form but without data – user2420469 Jun 15 '13 at 09:06
  • anyone can explain why data dont send to dialog it seems good to me but i cant figureout where is the probleme and why dont appears in dialog is it about primeface version or what plzz help – user2420469 Jun 16 '13 at 15:00