What is the role of resetValues attribute of <f:ajax> in JSF2.2?

2.5k Views Asked by At

I have gone through the JSF 2.2 docs, which mentions for this particular attribute,

If true, indicate that this particular Ajax transaction is a value reset transaction. This will cause resetValue() to be called on any EditableValueHolder instances encountered as a result of this ajax transaction. If not specified, or the value is false, no such indication is made.

What does the author meant by value reset transaction? I am unable to understand what basic functionality does it offers & when should it be used?

Please elaborate?

An example explaining it in below context would indeed be very helpful,

<h:inputText id="nameId" value="#{ajaxBean.name}" />
<h:commandButton value="Submit">
                <f:ajax onevent="ajaxMonitoring" 
                        execute="@form" 
                        resetValues="true" 
                        listener="#{ajaxBean.listener()}" 
                        render="@form"/>
</h:commandButton>
0

There are 0 best solutions below