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 8474613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:40:34+00:00 2026-06-10T17:40:34+00:00

I am trying to invoke the primefaces commanlink via javascript and want to know

  • 0

I am trying to invoke the primefaces commanlink via javascript and want to know whether it executed successfully or not and if it is successful i need to get the values which sent by callbackfunction. I am capturing the return value of the commandlinke which is a bunch of javascript. How to get the args(topicComment) value in my senario. I think i can do a workaround by setting few more hidden fields, but i want to see how to get it directly.

Javascript

$('.postButton').livequery("click", function (){
        var comment_content = $(this).parent().siblings().children('textarea').val();
        $('#topic_comment').val(comment_content);
        var object=$('#postCmdLink').click();
        var output;
        for (property in object) {
              output += property + ': ' + object[property]+'; ';
            }
            console.log(output);
}

Server side

public void addComment(){
        .................................
        context = RequestContext.getCurrentInstance();
        context.addCallbackParam("topicComment", topicBean.getTopicCommentVO().getTopicCommentGuid());

}

  • 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. Editorial Team
    Editorial Team
    2026-06-10T17:40:36+00:00Added an answer on June 10, 2026 at 5:40 pm

    Instead of clicking CommandLink by jQuery:

    var object=$('#postCmdLink').click();
    

    Uses Primefaces AjaxAPI to call ajax and register a callback to get the result:

    PrimeFaces.ajax.AjaxRequest({
             formId:'userForm'
             ,source:'userForm'
                ,process:'userForm'
             ,update:'msgs'
             ,params:{
                'param_name1':'value1',
                'param_name2':'value2'
             }
              ,oncomplete:function(xhr, status, args) {alert('Done');}  
            });
    

    Primefaces User documentation 3.1.1 section 7.2 Ajax API page 454.

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

Sidebar

Related Questions

I am trying to invoke a method via reflection with parameters and I get:
I'm trying to invoke a method from another class that means I want to
So I am trying to invoke methods on a page and I know the
I keep getting dialogDiv.dialog is not a function. I'm simply trying to invoke the
I am trying to invoke camera from HTML5 and JavaScript. My code is as
I am trying to invoke method via webservice (SOAP) I have generated Web service
This is not a common scenario. I am trying to invoke an exception through
Im trying to invoke a method in java from javascript, but this doesn't happen
I am trying to invoke sendmail via PHP's mail function by the following code:
I'm trying to invoke a webservice from a console application, and I need to

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.