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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:08:08+00:00 2026-06-03T19:08:08+00:00

I was trying something like below — <h:commandButton id=btnOK> <f:ajax event=action execute=@this render=idHeader listener=#{myBean.actionSubmit()}/>

  • 0

I was trying something like below —

<h:commandButton id="btnOK">
     <f:ajax event="action" execute="@this" render="idHeader"       
listener="#{myBean.actionSubmit()}"/>
</h:commandButton>

And I want when that ajax request completes, do some processing in the UI.I am using following jQuery code for that :

$(document).ajaxComplete(function() {
    $.modal.close();
});

But my problem is the jQuery method is not fired at all. I am wondering if JSF ajax submission fires the ajaxComplete event or not??

  • 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-03T19:08:11+00:00Added an answer on June 3, 2026 at 7:08 pm

    The standard JSF impl doesn’t use jQuery API to send ajax requests. JSF uses its own internal API which you can find in the auto-included jsf.js file. So the jQuery jQuery.ajaxComplete() is never called. It would only be called when jQuery’s $.ajax() (and its shortcuts $.get(), $.post(), etc) is being used. Only jQuery based component libraries use them such as PrimeFaces with <p:commandXxx> and <p:ajax>. For standard JSF <f:ajax>, you need to use JSF’s own jsf.ajax.addOnEvent() handler instead, or the onevent attribute of the <f:ajax>.

    In your particular case I think the onevent attribute is mose easy:

    <f:ajax ... onevent="btnOKhandler" />
    

    with

    function btnOKhandler(data) {
        if (data.status == 'success') {
            $.modal.close();
        }
    }
    

    The data.status can have 3 values: begin, complete and success. See also tables 14-4 and 14-3 of the JSF specification.

    See also:

    • Javascript on (before and after) every Ajax-call
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you add an event listener when a FLVPlayback starts? Something like below:
I have been trying to do something like below. JavaScript $.ajax({ url: 'login.php', type:
I'm trying something like this, but this example does not work. jsObj = {};
I'm trying something like this: [ServiceContract ( CallbackContract = typeof (CallbackContract_1), CallbackContract = typeof
I'm trying to do something like this in Java: public static <T> T foo()
I'm trying to do something like this... <Style x:Key=TwoByTwoGridStyle TargetType=Grid> <Setter Property=Grid.RowDefinitions> <Setter.Value> <ControlTemplate>
I'm trying to do something like this: SELECT MAX( ADDDATE(expirationdate, INTERVAL 1 YEAR), ADDDATE(now(),
I'm trying to do something like this in C++: if(){ int a; } else
I'm trying to replace something like this: NSSomeFunction(@some var, @another one) With: NSSomeOhterFunction(@some var)
I was trying to do something like below but it doesn't work. Why won't

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.