Using jsf 2 and Primefaces 3.4
I know that there are many similar questions, but none of them work on this.
When the "inner" grid panel is displayed with a fixed value of "true" ( <h:panelGrid id="inner" rendered="true"> ) => after pressing the control button, the input component correctly updates the value # {tableMatchesBean.mergedAuthorAjax},
but if the rendering of this panel is conditional : <h:panelGrid rendered="#{spellCheckBean.renderInputMerge}"> => then the input component is silent (no trace called by tableMatchesBean.mergedAuthorAjax).
Note. I used nested grids to place the rendering condition in the parent element of the component that should be conditionally rendered (output and input components). Any help was appreciated.
[EDIT after comment:] What the xhtml page does:
- when the user clicks on the "merge" parameter in selectOnebutton, the ajax update switches "renderInputMerge" to true, which leads to the display of the "external" component. It is working fine. This component has an input field that displays OK.
- after the user clicks on the commandLink button, I need to get the value of this input field. As explained above, I have a problem with this.
xhtml:
<h:body style ="width:100%"> <h:form id = "currMatch"> <h:panelGrid> <p:selectOneButton id ="selection" value="#{spellCheckBean.optionChosen}"> <f:selectItem itemLabel="keep both" itemValue="1" /> <f:selectItem itemLabel="delete both" itemValue="2" /> <f:selectItem itemLabel="merge" itemValue="3" /> <p:ajax update="outer" /> </p:selectOneButton> </h:panelGrid> <h:panelGrid id="outer" > <h:panelGrid id="inner" rendered="#{spellCheckBean.renderInputMerge}"> <h:outputText value="our suggestion: " style ="margin-left: auto; margin-right: auto"/> <h:inputText id ="testinput" value="#{tableMatchesBean.mergedAuthorAjax}"> </h:inputText> </h:panelGrid> </h:panelGrid> <p:commandButton action="#{tableMatchesBean.next_()}" title="Add" value="next" update ="currMatch" > </p:commandButton> </h:form> </h:body>
source share