1
votes

I have this JSF commandButton which I use to delete rows from table:

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

In Netbeans 7.3 I get this error:

The attribute update is not defined in the component commandButton

I use update attribute to display message when I successfully delete row. Can I replace this attribute with similar attribute?

1
update is a primefaces only attribute, which can't be used on stock JSF components (like the <h:commandButton/> you have there). The render attribute on the <f:ajax/> should be sufficient to achieve the desired effectkolossus

1 Answers

5
votes

The update attribute is specific to PrimeFaces <p:commandButton>. It's a convenience replacement of the standard JSF equivalent <f:ajax render>.

So, basically, the <p:commandButton ... update="growl" /> does essentially the same as:

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

Note that when the <p:growl id="growl"> is not inside the same form, then you should refer it using an absolute client ID instead, perhaps <f:ajax render=":growl">. If you would like to update the current form as well, then use <f:ajax render="@form :growl">. This is perhaps your case as you've currently already a render="@form" but still keeps asking about explicitly updating the growl, which suggests that it is actually not enclosed in the form at all.