i have a dialog to create a survey. The dialog has an inputText for the question and a button two add inputext for the possible answers. So when the users clicks on the button that is inside the dialog to add an answer i want to update the open dialog. when i click the button Add nothing happens.
I try some of the answers of other people problems here, but it doesn't work for me. I am using Primefaces 5.3
I try outside the dialog the "add" button and it works fine because the inputTexts appears, but inside the dialog it doesn't do anything. So the problem is in the way i am updating the content of the dialog
This is the code of the dialog:
<p:dialog id="newSurveyDialogo2" header="New Survey" widgetVar="dlg2" minHeight="40" resizable="false" appendTo="@(body)">
<p:ajax event="close" listener="#{surveyBean.handleClose}" update=":dialogOptions"/>
<h:form id="dialogOptions">
<p:outputLabel value="Question:"/> <br/>
<p:inputTextarea id="question" value="#{surveyBean.sQuestion.question}" rows="2" cols="50" counter="displayP" maxlength="50" counterTemplate="{0} " autoResize="true" required="true" requiredMessage="Question necessary"/> <br/>
<p:outputLabel id="displayP"/> <br/><br/>
<p:outputLabel value="Answers:"/> <br/>
<h:dataTable value="#{surveyBean.options}" var="item">
<h:column><h:inputText value="#{item.opcion}" /></h:column>
<h:column><h:commandButton value="remove" action="#{surveyBean.remove(item)}" /></h:column>
</h:dataTable>
<p:commandButton value="Add" action="#{surveyBean.add}" update=":dialogOptions"/> <br/><br/>
<p:separator/>
<p:commandButton value="Create new Survey" action="#{surveyBean.addSurvey()}" onclick="dlg2.hide()" update=":dialogOpciones"/>
</h:form>
</p:dialog>