I have this commandButton:
<p:commandButton value="View/Edit" onclick="bar.show()"
oncomplete="bar.hide(); dataSetUserDialog.show();"
actionListener="#{dataStoreBean.initUserLists}">
<p:ajax event="?" update="userSelect" ></p:ajax>
<f:param name="checkSum" value="#{dataSet.checkSum}" />
</p:commandButton>
And this dialog with a selectManyMenu inside:
<p:dialog header="View or Edit #{dataStoreBean.currentDataSetName} users"
widgetVar="dataSetUserDialog" modal="true" width="500" height="200">
<h:form>
<p:selectManyMenu id="userSelect" value="#{dataStoreBean.selectedUsers}" style="width: 475px;">
<f:selectItems value="#{dataStoreBean.users}"
var="user" itemValue="#{user.email}"
itemLabel="#{user.email} | #{user.groupName}" />
</p:selectManyMenu>
<p:commandButton value="Done"
actionListener="#{dataStoreBean.updateDataSetsUsers}"
onclick="dataSetUserDialog.hide()" type="submit" />
</h:form>
</p:dialog>
What I want to achieve is to have updated info in the dialog I want to show. userSelect is inside that dialog. So first I want #{dataStoreBean.initUserLists} to execute, and after that update (rerender) userSelect, and then show dataSetUserDialog. How can I do this?
As BalusC suggested, I should use
actioninstead ofactionListener: