我正在尝试执行JSF2 bean方法,并在单击PrimeFaces <p:commandButton>
后完成该方法后显示对话框。
<p:commandButton id="viewButton" value="View"
actionlistener="#{userBean.setResultsForSelectedRow}" ajax="false"
update=":selectedRowValues"
oncomplete="PF('selectedRowValuesDlg').show()">
</p:commandButton>
<p:dialog id="selectedRowValues" widgetVar="selectedRowValuesDlg" dynamic="true">
<h:outputText value="#{userBean.selectedGroupName}" />
</p:dialog>
当我点击命令按钮时,bean动作监听器方法setResultsForSelectedRow
能够正常执行,但是方法完成后并没有显示对话框。如果我移除actionlistener
,它就可以显示对话框了。我不知道出了什么问题。
事件的执行顺序是什么?是否可能同时执行actionlistener
和oncomplete
?
commandButton
上明确设置了ajax=false
,并尝试使用ajax update
。这样是行不通的。尝试移除ajax=false
,并在<p:commandButton/>
上添加process=@this
,同时你不能同时执行actionListener
和oncomplete
。 - SRyprocess=@this
,但它没有起作用。而且我无法同时执行actionListener和oncomplete,那么有其他方法可以使用吗? - Abhay