-1

I have a simple input text inside a primefaces dialog with a command button to test if the variable gets his value but when i click the command button with(process="@this" when i delete it the button dont work any more)to print the value of the property it shows always null ... the dialog is rented by a command link from a data grid and when i delete the dialog every thing works fine and the property get th value this is the jsf page :

<p:layoutUnit id="center" position="center"
                style="min-height:400px;min-width:300px;overflow-y:hidden !important"
                header="#{messages['layout.center.header']}">

 <f:view>
<h:form >

                    <p:dataGrid var="c" value="#{rentMB.carsList}" columns="3"
                        layout="grid" rows="12" paginator="true" id="cars"
                        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                        rowsPerPageTemplate="6,12,16">

                        <f:facet name="header">
                 Available Cars 
                 </f:facet>

                        <p:panel header="#{c.car_brand.brand_name}"
                            style="text-align:center">
                            <h:panelGrid columns="1" style="width:100%">
                                <p:graphicImage url="/images/#{c.image}.jpg" />
                                <p:commandLink 
                                    oncomplete="PF('carDialog').show()" title="View Detail">
                                    <h:outputText styleClass="ui-icon ui-icon-key"
                                        style="margin:0 auto;" />
                                    <f:setPropertyActionListener value="#{c}"
                                        target="#{rentMB.selectedCar}"  />
                                </p:commandLink>
                            </h:panelGrid>
                        </p:panel>

                    </p:dataGrid>
</h:form>


 <h:form>
                    <p:dialog header="Car Info" id="carInfo" widgetVar="carDialog" width="900px"
                        height="400px" showEffect="fade" hideEffect="fade"
                        resizable="false" appendToBody="true">
              <p:outputPanel>                       
<h:panelGrid columns="3" >

                                    <f:facet name="header">
        Client informations
                      </f:facet>


                                 <h:outputLabel for="adress" value="Adress : *" />
                                    <p:inputText id="adress" value="#{rentMB.adress}"
                                        />
                                        <p:watermark for="adress" value="Adress" />

                                    <p:commandButton action="#{rentMB.affiche}"   process="@this" value="Rent" oncomplete="carInfo.hide();" >  </p:commandButton>

                                    <p:commandButton type="reset" value="Reset">  </p:commandButton>
                            </h:panelGrid>
                            </p:outputPanel> 
                        </p:dialog>
                </h:form>
                </f:view>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</f:view>
</html>

the code of rentMB.affiche() :

public void affiche()
    {
        System.out.println(this.getAdress());
    }
elpazio
  • 697
  • 2
  • 9
  • 25
  • I think you have to get back to some basics and describe from a developer point of view e.g. what is not working about the button if the `process` attribute is removed. There are many reasons why this might [not work](http://stackoverflow.com/questions/2118656/commandlink-commandbutton-ajax-backing-bean-action-listener-method-not-invoked). – Kukeltje Mar 06 '15 at 00:33

1 Answers1

-1

the solution is to put the content of the p:dialog between <h:form></h:form> and add to dialog appendToBody="false"

elpazio
  • 697
  • 2
  • 9
  • 25