Refresh form using submit button

Hi,

I have a pbm with a form. I have two textboxes and a submit button in my form. When I click the submit button after entering values into the textbox, a Bean is called to validate the input values.

If I enter value in one textbox and leave the other one blank and click the submit button, the bean is called and the error message is displayed in the same page. My pbm is the value I have entered in one of the textbox is also refreshed to blank. Can anyone please tell me if there is some attribute that can be set in the submit button so that the values in the form will not be refreshed ?

Thanks,

Angeline

Message was edited by:

MaryAngeline

Message was edited by:

MaryAngeline

Message was edited by:

MaryAngeline

[789 byte] By [MaryAngelinea] at [2007-11-27 6:25:39]
# 1
Have you tried using session scoped beans? Your "getters" will still be called but they should still hold their value.-t
skepticala at 2007-7-12 17:45:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi,Sorry for the late reply.The scope was request. I have changed it to session and now it works fine. Thank you so much for the reply.Angeline
MaryAngelinea at 2007-7-12 17:45:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

That solution doesn't make any sense, there is no reason that request scoped beans wouldn't work. In other words, there is something else going on, and if you don't figure it out, it might bite you later.

If you have a text box associated to a property on a request scope bean and an error causes the page to be re-rendered, here is what happens: The request scope bean is instantiated. The property is set on the bean. The JSF system determines that the same view will be re-rendered. While the view is rendered, it accesses the bean property. Since we are still on the same request, it has the value.

RaymondDeCampoa at 2007-7-12 17:45:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...