【问题标题】:primefaces disable commandButtonprimefaces 禁用命令按钮
【发布时间】:2015-10-30 03:42:35
【问题描述】:

我有下面的primefaces代码p:commandButton。我已将更新和oncomplete 属性设置为禁用p:panelGrid 的"panelGrid1s4a3b1" 中的commandButton,并在p:message 的"customMessage1s4" 上显示消息。但不知道为什么这两个不起作用。任何人都可以帮助我使它们工作吗?

<p:commandButton id="cmdVerify1s4a2" widgetVar="cmdVerify1s4a2" 
value="Verify" action="approveProfileQualifications" 
update="@([id$=panelGrid1s4a3b1]), @([id$=customMessage1s4])" 
oncomplete="PF(cmdVerify1s4a2).disable(); PF('cmdReject1s4a2').disable();"/>

【问题讨论】:

    标签: primefaces commandbutton disabled-control


    【解决方案1】:

    你不更新是对的。改变你的p:commandButtonlittle

    update="panelGrid1s4a3b1 customMessage1s4" 
    

    虽然我相信你的p:messages 喜欢

    <p:messages id="customMessage1s4" showDetail="true" autoUpdate="true" closable="true" />
    

    更多

    也可以使用关键字更新:

    Keywords are the easier way to reference components, they resolve to ids so that if an id changes,
    the reference does not need to change. Core JSF provides a couple of keywords and PrimeFaces
    provides more along with composite expression support.
    

    以下是关键字。

    @this 标准电流组件。 @all 标准整体视图。 @形式 当前组件的标准最接近祖先形式。 @none 标准否 零件。 @namingcontainer PrimeFaces 最近的祖先命名 当前组件的容器。 @parent PrimeFaces 的父级 当前组件。 @composite PrimeFaces 最近的复合组件 祖先。 @child(n) PrimeFaces 第 n 个孩子。 @row(n) PrimeFaces 第 n 行。 @previous PrimeFaces 上一个兄弟姐妹。 @next PrimeFaces 下一个兄弟姐妹。 @widgetVar(name) 具有给定 widgetVar 的 PrimeFaces 组件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多