File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Display alert message for Delete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Display alert message for Delete" Watch "Display alert message for Delete" New topic
Author

Display alert message for Delete

Sam Saha
Ranch Hand

Joined: Jan 23, 2010
Posts: 104
I wanted to display two different java script alert messages from one Delete button.
When try to delete a person for Auto the message should be:
"Are you sure you would like to delete this Named Person for Auto?"
When try to delete a person for Hab the message should be:
"Are you sure you would like to delete this Named Person for Hab?"

Now it display the same message "Are you sure you would like to delete this Named Person for Auto?" for both Auto and Hab. But I wanted to split them for Auto and Hab.

I have a ternary condition like
value="#{pc_EndorseNamedPerson.habPolicy ? msg.habnamedPersonDel : msg.namedPersonDel}" which basically displays two different text in the Delete button for Auto and Hab. I wanted to use this same condition for java script alert message. But I am not really sure how to use this in java script function. I would appreciate if some body can help me how to use this ternary condition in java script method to display two different messages

JSP Code:



Java script function:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Moved to the JSF forum. Please don't post JSF markup in the HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display alert message for Delete
 
Similar Threads
using JSP variable in java script
display validation message as an alert in jsp which uses struts 2 validation.xml
display validation message as an alert in jsp which uses struts 2 validation.xml
Set a method when clicked on a hyperlink
Creating a masked popup in JavaScript