• 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

JSP action link with confirmation

 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys

Got a small issue. I have a commandLink element. I want to intercept the clicking of this with a javascript confirm box.

I can show the confirm box using the onClick event handler but I need to only perform the link's action if the confirm box returns true (if the OK button is clicked).

Does anyone have any idea how to do this?

Thanks in advance
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why don't u do it in faces-config.xml? u can link the page from there to go to another new page.

but if u really want to do it in javascript, u can first call a javascript function and then in the javascript function u do alert and also redirect.
[ July 04, 2005: Message edited by: Jolie Lee ]
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Thanks for your reply.

I have a navigation rule in faces-config.xml - this works fine. I can also attach a JS confirmation to the command link, that pops up fine. What doesnt work is only firing the action on my command link if the user presses OK on the confirmation box
 
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
u can pass the message and link from ur bean to ur jsp page..

and in ur jsp page u can do something like this..

so when user clicks OK, it will go to the messageLink that u specify from ur bean.

hope this helps.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic