GeeCON Prague 2014*
The moose likes JSF and the fly likes How to find UI values are changed by the user or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "How to find UI values are changed by the user or not?" Watch "How to find UI values are changed by the user or not?" New topic
Author

How to find UI values are changed by the user or not?

Srinivas Bonala
Greenhorn

Joined: Feb 14, 2012
Posts: 15
thanks in advance...

Am new to JSF Technology and We have an application developed by JSF technology. In that we have scenario called editUserDetails.
When the user enter into edit scenario we will display all details of the user at the time of registration.

Few of this details will be displaying in input feilds and some of in checkboxes and some in selection fields.

My requirement is that we want to show a pop up when the user tries to changing the actual values.

Example:
If the user changed his username in the username field. and he tries to click on other link(goto home page or site map or FAQ's links)
in that page. When he changed something value and trying to click on any other link i want to
show the pop up with two buttons, one for save the changes button and second one for discard the
changes.

My question is how do we know that the actual values are changed by the user or not. If changed i want to display pop up else we need to navigate the user to the perticular link.

Can any one please give me a possible scenario how to do this.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

If I read you correctly, what you want is all client-side processing, and the standard JSF tags don't provide a service like that.

You can, however, write JavaScript that attaches to each control and have the control's onchange method set a "dirty" flag. Then a link or submit button could test that flag and display a confirm dialog.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
GeeCON Prague 2014
 
subject: How to find UI values are changed by the user or not?