属性更新未在组件commandButton中定义

时间:2013-02-25 14:43:01

标签: jsf jsf-2

我有这个JSF commandButton用于删除表中的行:

<h:commandButton id="deleterow" value="HiddenDelete"  action="#{BatteryProfileTabGeneralController.saveData}" style="display:none" update="growl">
    <f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>

在Netbeans 7.3中,我收到此错误:

The attribute update is not defined in the component commandButton

我成功删除行时使用update属性来显示消息。我可以用类似的属性替换此属性吗?

1 个答案:

答案 0 :(得分:5)

update属性特定于PrimeFaces <p:commandButton>。它是标准JSF等效<f:ajax render>的便利替代品。

所以,基本上,<p:commandButton ... update="growl" />基本上与:

相同
<h:commandButton ...>
    <f:ajax render="growl" />
</h:commandButton>

请注意,当<p:growl id="growl">不在同一表单中时,您应该使用绝对客户端ID来引用它,可能是<f:ajax render=":growl">。如果您还想更新当前表单,请使用<f:ajax render="@form :growl">。这可能是你的情况,因为你现在已经是render="@form",但仍然一直在询问明确更新咆哮,这表明实际根本没有包含在表单中。