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

Pet*_*zov 1 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>
Run Code Online (Sandbox Code Playgroud)

在Netbeans 7.3中我收到此错误:

The attribute update is not defined in the component commandButton
Run Code Online (Sandbox Code Playgroud)

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

Bal*_*usC 5

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

所以,基本上,<p:commandButton ... update="growl" />它基本上是相同的:

<h:commandButton ...>
    <f:ajax render="growl" />
</h:commandButton>
Run Code Online (Sandbox Code Playgroud)

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