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

  • Home
  • SEARCH
  • 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 954767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:16:13+00:00 2026-05-16T00:16:13+00:00

I have a problem integrating JQuery with JSF. I use Spin. and I have

  • 0

I have a problem integrating JQuery with JSF.

I use Spin. and I have in my code:

<script type="text/javascript" src="#{request.contextPath}/scripts/jquery.selectbox-0.5.js"></script>
    jQuery(document).ready(function($){
      $.spin.imageBasePath = '../images/spin1/';
      $('#spin1').spin();
      $('#spin2').spin();
      $('#spin3').spin();
    }

When I invoke the page for the first time, the “spin” is being added to components.

The problem is that I have as well, and once I invoke it and update part of the page (where I have the spinners) – it doesn’t function anymore. It seems that Jquery is being invoked only on page read and once refreshing a part of it – i would execute it anymore.

I tried to use h:commandButton with f:ajax but it didn’t solve the problem.

I tried to move the script inside the form that is being rendered, but it doesn’t help

How can I solve this?

  • 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-05-16T00:16:13+00:00Added an answer on May 16, 2026 at 12:16 am

    In a nut, you’d like to re-execute it whenever the ajax request has been completed?

    Move it into a function like so:

    jQuery(document).ready(function() {
        jQuery.spin.imageBasePath = '../images/spin1/';
        runSpinners();
    });
    function runSpinners() {
        jQuery('#spin1').spin();
        jQuery('#spin2').spin();
        jQuery('#spin3').spin();
    }
    

    This way you can reuse it in the oncomplete attribute of the <p:commandButton>.

    <p:commandButton oncomplete="runSpinners()" />
    

    Alternatively, you can also use <p:ajaxStatus> to execute it on complete of every ajax call, regardless of the button/link pressed:

    <p:ajaxStatus oncomplete="runSpinners()" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently integrating a payment system into my website. I have a response script
I am having this problem. I have integrated structuremap with wcf like it is
i'm supposed to write code which when given a text file (source code) as
I have to solve the following convolution related numerical integration problem in R or
As per my previous question , I have a working animation which fades in
Being new to integrating sharepoint documents into web applications I am struggling with the
Is it valid in XML-RPC to have an unbounded array of elements without having
I recently ran into a few problems with a third party vendor integration. In
I'm currently internationalizing an existing PHP project and thought the easiest way to do
I'm currently writing an AI for a game that is written in c++. The

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.