Jsf primefaces:在commandlink中更新之前执行操作
我有一个对话框和一个显示此对话框的CommandLink。在此对话框中,我显示在命令链接的操作(或propertyListener)期间创建的值。但是因为更新是在操作之前执行的,所以没有设置变量Jsf primefaces:在commandlink中更新之前执行操作,jsf,primefaces,Jsf,Primefaces,我有一个对话框和一个显示此对话框的CommandLink。在此对话框中,我显示在命令链接的操作(或propertyListener)期间创建的值。但是因为更新是在操作之前执行的,所以没有设置变量 <p:commandLink update="@form:myDialog" action="#{myBean.setText('text')}" oncomplete="myDialog.show()"> </p:commandLink> .... <p:dialog w
<p:commandLink update="@form:myDialog" action="#{myBean.setText('text')}"
oncomplete="myDialog.show()">
</p:commandLink>
....
<p:dialog widgetVar="myDialog" modal="true">
<p:inputText value="#{myBean.text}" />
</p:dialog>
....
是否可以在更新完成之前执行操作?I对话框将更新您尚未指定对话框的Id属性的对话框
<p:commandLink update="myDialog" action="#{myBean.setText('text')}"
oncomplete="myDialog.show()">
</p:commandLink>
<p:dialog Id="myDialog" widgetVar="myDialog" modal="true">
<p:inputText value="#{myBean.text}" />
</p:dialog>
您可以从ManagedBean本身打开该对话框
RequestContext.getCurrentInstance().execute(myDialog.show());
可用于执行ManagedBean中的任何javascript。您还可以使用的从托管Bean更新组件 方法
RequestContext.getCurrentInstance().update("COMPONENT_ID");
请张贴stacktrace。我更改了描述。没有异常,也没有堆栈跟踪。
RequestContext.getCurrentInstance().execute(myDialog.show());
RequestContext.getCurrentInstance().update("COMPONENT_ID");