Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 42829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:23:57+00:00 2026-05-10T15:23:57+00:00

If you have a JSF <h:commandLink> (which uses the onclick event of an <a>

  • 0

If you have a JSF <h:commandLink> (which uses the onclick event of an <a> to submit the current form), how do you execute JavaScript (such as asking for delete confirmation) prior to the action being performed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:23:58+00:00Added an answer on May 10, 2026 at 3:23 pm
    <h:commandLink id='myCommandLink' action='#{myPageCode.doDelete}'>     <h:outputText value='#{msgs.deleteText}' /> </h:commandLink> <script type='text/javascript'> if (document.getElementById) {     var commandLink = document.getElementById('<c:out value='${myPageCode.myCommandLinkClientId}' />');     if (commandLink && commandLink.onclick) {         var commandLinkOnclick = commandLink.onclick;         commandLink.onclick = function() {             var result = confirm('Do you really want to <c:out value='${msgs.deleteText}' />?');             if (result) {                 return commandLinkOnclick();             }             return false;         }     } } </script> 

    Other Javascript actions (like validating form input etc) could be performed by replacing the call to confirm() with a call to another function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ajax execute-tag embedded in a commandLink-Tag in my JSF-File, which works
In my JSF file I have below at the start. <h:form><h:commandLink value=Create New Staff
Suppose i have JSF page <h:body> <h:form id=formID prependId=false> <h:outputText id=randomID value=#{randomNumber.random}/> <h:commandButton id=buttonID
i have a jsf page which displays an image from an url http://ichart.finance.yahoo.com/z?s=^NSEI&t=1d&q=l&l=on&z=l&p=s&a=v&p=s i
I have a JSF application that uses mostly Richfaces. I would like to introduce
I want to have a generic menu in my JSF (MyFaces 1.2) application. <h:form>
I have a jsf datatable inside my form like this. <h:form id=personId> <h:dataTable id=hdatatable
I have a JSf form, I am tryin' to use jQuery Ui dialog plugin
I have a problem with using jQuery Dialog and Ajax submit in JSF. I
I have a JSF application with a Data Table. Each row has a 'commandLink'.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.