aspose file tools
The moose likes JSF and the fly likes click twice to save Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "click twice to save" Watch "click twice to save" New topic
Author

click twice to save

Jolie Lee
Ranch Hand

Joined: May 08, 2005
Posts: 87
my form need to click twice on the commandButton only able to save. when i click the first time, no error, the page refresh and remains.. when i clicked on the 2nd time, it'll only save into the db.

i'm not sure wat's wrong. in my form, i have a selectOneMenu, onchange with valueChangeListener, and my commandButton used actionListener to link to the backing bean.

will it be the valueChangeListener caused this?

kindly advise. thks.


Jys<br /><a href="http://jy-s.com" target="_blank" rel="nofollow">http://jy-s.com</a><br /> <br />Trying my very best to learn java, please forgive me if i'm asking some really stupid questions.
Jolie Lee
Ranch Hand

Joined: May 08, 2005
Posts: 87
I've figured it out, it is the valuechangelistener that caused this thing happened!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14456
    
    7

If you mean double-clicking, someone asked me a question like that just yesterday. Unlike GUI desktops, the web was designed for single-click operations. You can add double-click functionality via Javascript, but it's risky, since users can turn javascript off.

Trying to make double-clicking work without Javascript in JSF can be a problem, since if the user double-clicks, they're sending 2 page requests in rapid succession - probably too fast to be handled completely.

If, on the other hand, you literally want the button to do one thing when clicked once, but after an interval do something else next time, the best thing to do is visually modify the page as part of the first click's action process so that they can see that the next click will be different. This can be done as easily as changing the value of a boolean property queried by a "rendered=" attribute on a JSF page display object.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: click twice to save
 
Similar Threads
JSF - SelectManyListBox doesnt populate on valeChangeevent
Question for double click issue regarding fileload with commandLink/CommandButton
Problem after rendering a commandButton
A Problem with events
rich faces pick list with valueChangeListener attribute ( not working)