JSF Autosaving?

Hi all,

I have a fairly simple program that allows me to pull info from a database and display it in a datatable.

I can then choose to edit any row in the datatable. The row info is displayed in a new page to edit.

My problem is on this new page. There are two buttons, one saves the info, one cancels. The save button just replaces the old info with the new info. The cancel button just has a string like action="cancel"

that returns to the previous page.

However if I change a value in the form (like the value of a selectOneMenu) and then decide to press cancel, that new value (of the selectOneMenu) is displayed on the pevious page, even though the save method has not been called.

Any ideas why this happens? It seems strange. All that happens is a navigation rule!

Cheers,

Illu

[866 byte] By [Illua] at [2007-11-26 16:06:17]
# 1
Put immediate="true" on your cancel button.Immediate will force JSF to process the Cancel button before updating the model.CowKing
IamCowKinga at 2007-7-8 22:28:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks CowKing, that worked a charm!Illu
Illua at 2007-7-8 22:28:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...