I have one Problem with the inplace Tag from JSF Primefaces
Here is a code snippet
<h:form >
<p:inplace id="ajaxInplace" editor="true">
<p:inputText value="#{productService.instance.productName}"required="true" label="text"/>
</p:inplace>
</h:form>
after the I press the confirmation button of the ajax inplace i want to store the changed data to my database. i have a method productService.updateInstance() to do this. but how can i call this method after the changes has been made?
thank you and kind regards
Use <p:ajax event="save"
save and cancel are two provided ajax behaviors events you can use to hook-in the editing process.
<p:inplace id="ajaxInplace" editor="true">
<p:ajax event="save" listener="#{productService.handleSave}" update="someThing" />
<p:inputText value="#{productService.instance.productName}" required="true" label="text"/>
</p:inplace>
Where handleSave
looks like this
public void handleSave() {
//do something here
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With