File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while resetting values

 
Balaji Kadam
Ranch Hand
Posts: 31
Hibernate Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
Chrome Eclipse IDE Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Balaji Kadam
Ranch Hand
Posts: 31
Hibernate Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic