• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem while resetting values

 
Ranch Hand
Posts: 31
Hibernate Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 121
Mac Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic