This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Problem while resetting values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem while resetting values" Watch "Problem while resetting values" New topic
Author

Problem while resetting values

Balaji Kadam
Ranch Hand

Joined: Apr 27, 2010
Posts: 31

Hi:

While reseting values in JSF it is not reset. I have declare inputbox as


and i want to set this blank on Reset button click event. so i have used,


But it not works.

So can any body help me to solve this?


Thank You,
Balaji
suresh dasari
Ranch Hand

Joined: Oct 05, 2009
Posts: 121

Hi Balaji,

why you need binding for an inputText, is there any specific reason?

An alternative for solving this issue is try to enclose the inputText in a panelGrid or panelGroup and in reset button click set the required value to '0' and rerender the panelgrid which will refresh only inputText with value set back to blank.

Thanks,
Suresh.


Sun Certified Java Programmer with 93 percent
Balaji Kadam
Ranch Hand

Joined: Apr 27, 2010
Posts: 31

suresh dasari wrote:Hi Balaji,

why you need binding for an inputText, is there any specific reason?

An alternative for solving this issue is try to enclose the inputText in a panelGrid or panelGroup and in reset button click set the required value to '0' and rerender the panelgrid which will refresh only inputText with value set back to blank.

Thanks,
Suresh.


Thanks for reply. But i am not getting what exactly.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

The normal operation of the HTML RESET button is to re-initialize the values of all controls in the form that contains the RESET button to whatever values they had when the page was loaded. This is done internally by the browser automatically without using JavaScript.

If you attach AJAX and/or JavaScript to the process, it will do exactly what you tell it to do, so you need to be careful that you know what it is that you are telling it to do.

In particular, a partial page refresh done by AJAX will reload the indicated parts of the page using the current values of the backing bean (instead of the values from when the page was initially loaded), and that, in turn will affect how the default behavior of the RESET button applies. For all practical purposes, the RESET button will think that the form was originally set to the original property values except that its concept of "original values" will have been updated to reflect the AJAX-driven changes to the backing bean. And only those changes. Updates to control values that were not re-rendered by AJAX will not be noted by RESET and therefore RESET will change those controls back to their original values as of page-load time.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem while resetting values
 
Similar Threads
oracle.jdbc.V8Compatible=true
equality doubt
html:select vanishing values
how to reset the form?
resetting a Thread loop timer