I have a p:dialog where dynamic is set to true. In the command button, I am calling it to be displayed such <p:commandButton ajax="true" actionListener="#{bean.setCurrentElement(element)}" oncomplete="myDialog.show" update=":myForm:myDialogId"/>
. Inside the dialog, I have a <p:selectOneMenu value="#{bean.currentElement.someId}
"`
When I click on the command button, the code blows up since the bean.currentElement is accessed before the action listener is complete there by rendering it null. When I use <h:outputText>
, dialog displays properly. My dialog is defined as <p:dialog header="Bla" widgetVar="myDialog" modal="true" id="myDialogId"
dynamic="true">
The bean is viewScoped. Any ideas why the dialog is rendered before the action Listener method is called. ?