• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

click twice to save

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jolie Lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've figured it out, it is the valuechangelistener that caused this thing happened!
 
Saloon Keeper
Posts: 26291
186
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
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.
 
It's a tiny ad only because the water is so cold.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic