I have a situation in which there is an input text and a submit and cancel button.
The input text value is associated with a backing bean property.
Suppose the user enters any value and clicks cancel, the same page is displayed with the input text in view mode(not editable)
The problem is that since we are re-displaying the page the backing bean has been associated with the value that was set when the user entered the value in input text and hence the same value is displayed.
I am currently using 2 properties in the backing bean and doing some manipulations to overcome this issue.
Add immediate="true" attribute for your Cancel button.
Create a navigation rule for your Cancel button action which points to the same page.
“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
posted 11 years ago
But now I am facing another problem, when I am redisplaying the same page the value in the text field is not getting changed(it is having the value that was entered before cancel button was clicked)
I am not able to understand this behaviour, since I guess due to immediate=true the model values would not have been updated and hence the property of the backing bean which is associated with the input text should not have been updated and should have displayed value of the property in the input text.
But the text entered before cancel action is getting displayed.