I'm a beginner in JSF. I am developing an application for managing facilities. The index page contains the list of properties with three buttons for inserting, updating and deleting a property.What I want to do is, once I click on the button "add new property", display a dialog with fields to fill and a button to save. Once I fill in fields and click on "save", the list of properties is automatically refreshed. All that on the same page. I've tried many solutions but it's not working. I've also tried the answers suggested in other questions but it's not working on my page. I've copied my code and paste it in an other page and it's working, i don't know where is the problem
This is my code
<section class="content">
<h:form id="a" enctype="multipart/form-data">
<h:panelGrid columns="1" cellpadding="5">
<p:commandButton value="Add property" type="button" icon="ui-icon-adds" onclick="PF('dlg1').show();" />
<br/>
</h:panelGrid>
<p:dataTable var="property" value="#{propertybean.propertyList}" id="AjoutTab" rows="10"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15"
widgetVar="propsTable"
emptyMessage="No property found with given criteria" >
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Search all fields:" />
<p:inputText id="globalFilter" onkeyup="propsTable.filter()" style="width:150px" placeholder="Enter keyword"/>
</p:outputPanel>
</f:facet>
<p:ajax event="sort" skipChildren="false" />
<p:column headerText="Name" sortBy="#{property.propName}" filterMatchMode="contains">
<h:outputText value="#{property.propName}"></h:outputText>
</p:column>
<p:column headerText="Valid From" sortBy="#{property.propValidfromDate}" filterMatchMode="contains">
<h:outputText value="#{property.propValidfromDate}"></h:outputText>
</p:column>
<p:column headerText="Valid To" filterMatchMode="contains">
<h:outputText value="#{property.propValidtoDate}"></h:outputText>
</p:column>
<p:column headerText="Country" filterMatchMode="contains">
<h:outputText value="#{property.propCountry}"></h:outputText>
</p:column>
<p:column headerText="Street name" filterMatchMode="contains">
<h:outputText value="#{property.propStreetname}"></h:outputText>
</p:column>
<p:column headerText="Street number" filterMatchMode="contains">
<h:outputText value="#{property.propStreetnb}"></h:outputText>
</p:column>
<p:column headerText="Zip code" filterMatchMode="contains">
<h:outputText value="#{property.propPostcode}"></h:outputText>
</p:column>
<p:column headerText="Length" filterMatchMode="contains">
<h:outputText value="#{property.propLength}"></h:outputText>
</p:column>
<p:column headerText="Width" filterMatchMode="contains">
<h:outputText value="#{property.propWidth}"></h:outputText>
</p:column>
<p:column headerText="Status" filterMatchMode="contains">
<h:outputText value="#{property.propStatus}"></h:outputText>
</p:column>
<p:column headerText="Area" filterMatchMode="contains">
<h:outputText value="#{property.propArea}"></h:outputText>
</p:column>
<p:column headerText="Comment" filterMatchMode="contains">
<h:outputText value="#{property.propComment}"></h:outputText>
</p:column>
</p:dataTable>
<p:dialog header="New property" widgetVar="dlg1" minHeight="40">
<p:growl id="growl" showDetail="true" sticky="false" life="10000"/>
<h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">
<f:facet name="header">
<h:outputLabel value="Fill in fields"/>
</f:facet>
<h:outputLabel for="Id" title="Id" value="Id:" style="color: crimson;" />
<h:inputText value="#{propertybean.propId}" id="Id" required="true"/>
<h:outputLabel for="Name" value="Name property:" style="color: crimson;"/>
<h:inputText id="Name" value="#{propertybean.propName}" required="true"/>
<h:outputLabel for="propValidfromDate" value="Valid from:" style="color: crimson;"/>
<p:calendar id="propValidfromDate" value="#{propertybean.propValidfromDate}" required="true"/>
<h:outputLabel for="propValidtoDate" value="Valid to:" style="color: crimson;"/>
<p:calendar id="propValidtoDate" value="#{propertybean.propValidtoDate}" required="true"/>
<h:outputLabel for="country" value="Country:" style="color: crimson;"/>
<h:inputText id="country" value="#{propertybean.propCountry}" required="true"/>
<h:outputLabel for="propStreetname" value="Street name:" style="color: crimson;"/>
<h:inputText id="propStreetname" value="#{propertybean.propStreetname}" required="true"/>
<h:outputLabel for="propStreetnb" value="Street number:" style="color: crimson;"/>
<h:inputText id="propStreetnb" value="#{propertybean.propStreetnb}" required="true"/>
<h:outputLabel for="propPostcode" value="Zip code:" style="color: crimson;"/>
<h:inputText id="propPostcode" value="#{propertybean.propPostcode}" required="true"/>
<h:outputLabel for="propLength" value="Length:" style="color: crimson;"/>
<h:inputText id="propLength" value="#{propertybean.propLength}" required="true"/>
<h:outputLabel for="propWidth" value="Width:" style="color: crimson;"/>
<h:inputText id="propWidth" value="#{propertybean.propWidth}" required="true"/>
<h:outputLabel for="propStatus" value="Status:" style="color: crimson;"/>
<h:inputText id="propStatus" value="#{propertybean.propStatus}" required="true"/>
<h:outputLabel for="propArea" value="Area:" style="color: crimson;"/>
<h:inputText id="propArea" value="#{propertybean.propArea}" required="true"/>
<h:outputLabel for="propComment" value="Comments:" style="color: crimson;"/>
<h:inputText id="propComment" value="#{propertybean.propComment}" required="true"/>
</h:panelGrid>
<p:separator/>
<p:commandButton value="Save" action="#{propertybean.addProperty()}" />
</p:dialog>
</h:form>
I'd be grateful if anyone could help