Just want to add more description to my problem above.
It does rerender when I set the button immediate=true, except it doesnt rerender all inputtext. All the values that I display under outputtext does rerender.
You're a live saver. Thanks.
I meant 'life saver'.
I have the same problem : I'm trying to reset a form, with a a4j:commandButton that call "myBean.refresh()" method.
In this refresh method, I change the managed bean value of my inputText back to the initial value that I want to see.
I put off "immediate=true", and tried with either "a4j:region" around the reset button, or "ajaxSingle=true" on the reset button.
In that cases, my form is correctly refreshed, if I didn't submit the form previously.
But if I do the following :
- modify a value
- submit and get a validation error
- click "refresh" button, then values are not refreshed.
I tried to use a backing bean for my inputText. Then, in refresh method, I do a :
myValueBean = refreshValueIWantToSee; // (As I did before)
=> That way, this works. But if I have many inputText in the form, I have to :
- declare one managed bean for each (as I did before)
- declare one backing bean for each in JSP and Java Class
- call setSubmittedValue() method on each of these backing bean in refresh method.
I find this way a little heavy / tiresome ( ? sorry for my bad english !!). Is there a better way to do this ?
I read the link http://labs.jboss.com/wiki/RichFacesTwoInputText with interest, but just using a4j:region doesn't work for me... I am certainly missing something.
Thanks for any suggestion...
do you read the topic that Sergey proposed?
Thanks for your post, and sorry for answering only now ! I thought I would receive an email telling me I got an answer to my post... But I didn't.
And can't find where I have to click to watch for a topic... :-(
Is it possible to watch for topics ?
Yes, I read the link "wiki/RichFacesTwoInputText". And what I understood, is that the only way to get it working is to use "setSubmittedValue" method, what I am doing successfully.
I just hoped there could be a "better" way.
I found another way to do a "refresh", without having to call setSubmittedValue() method for each backing bean component :
- define backing bean only for form component containing all other input components
- in Refresh method :
- initialize value managed beans
- call : myFormBackingBean.getChildren().clear();
- Don't forget to reRender panel or form
For explanations, read : http://wiki.apache.org/myfaces/ClearInputComponents