Monday, January 14, 2013

Popup Cancel

Popup Cancel (Default) button would revert the changes that are done on the popup. This can be achieved with a custom button by adding "resetActionListener" tag to the button.

Refer to resetActionListener summary information for more details

As mentioned in the above link,
"All values submitted will be reset to null or empty, and all editable components will be updated with the current values of the model on the server"

If a popup has an attribute whose "AutoSubmit" property is set to true, and if the user updates that attribute, the model gets updated. Now, if the user clicks on "Cancel" button, the attribute value wouldn't be reverted as the model gets updated.

As a workaround, one can store the values of all the attributes (with autosubmit=true) in a Map while fetching the popup and reset these values in the popupCancelEvent.

No comments: