我有以下primefaces p:commandButton的代码。我已经将update和oncomplete属性设置为在p:panelGrid of "panelGrid1s4a3b1"中禁用commandButton,并在"customMessage1s4"的p:message上显示消息。但不知道为什么这两个不能工作。有人能帮我让它们工作吗?
<p:commandButton id="cmdVerify1s4a2" widgetVar="cmdVerify1s4a2"
value="Verify" action="approveProfileQualifications"
update="@([id$=panelGrid1s4a3b1]), @([id$=customMessage1s4])"
oncomplete="PF(cmdVerify1s4a2).disable(); PF('cmdReject1s4a2').disable();"/>发布于 2015-10-30 13:37:44
你没有更新是对的。稍微改变一下你的p:commandButton
update="panelGrid1s4a3b1 customMessage1s4" 虽然我相信你的p:messages喜欢
<p:messages id="customMessage1s4" showDetail="true" autoUpdate="true" closable="true" />MORE
您还可以使用关键字来更新:
关键字是引用组件的更简单的方法,它们可以解析为id,这样,如果id发生更改,引用就不需要更改。Core JSF提供了几个关键字,PrimeFaces提供了更多的关键字以及复合表达式支持。
以下是关键字。
@此标准电流组件。@all Standard整体视图。@form标准当前组件的最接近的祖先形式。@none标准无组件。@namingcontainer PrimeFaces当前组件最近的祖先命名容器。当前组件的@parent PrimeFaces父项。@composite最近的复合组件祖先。@ child (n) PrimeFaces第n个子对象。@ row (n) PrimeFaces第n行。@previous PrimeFaces上一个同级。@next PrimeFaces下一个兄弟。@widgetVar(名称)具有给定widgetVar的PrimeFaces组件。
https://stackoverflow.com/questions/33428305
复制相似问题