Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
jQuery unblockUI() is triggered by ajax redirect

I've got an icon with a process attribute so when I click on the icon an ajax submit is triggered.

Now, as long as the icon's action is running I want to block the page with jQuery's blockUI() function. It works perfectly fine with regular submits (without ajax), but on ajax submits the page is only blocked for a short time so it is falsely possible to make a second submit before the first one is finished.

I analyzed the network traffic in Firefox and noticed the following:

On a regular submit (without ajax) the POST-method's answer is "302 Found" while on an ajax submit a redirect is performed so the answer here is "200 OK" with the answer message <partial-response><redirect url="myURL"></redirect></partial-response>.

I debugged and realized that at some point I end up in PrimeFaces' core.js file with the function PrimeFaces.ajax.ResponseProcessor.doRedirect(a); which again calls window.location.assign(b.getAttribute('url')).

With this assign, the blockUI is lost.

My question: What can I do so the blockUI is not lost on an ajax redirect?

I am using the following code in my xhtml-file:

<p:ajaxStatus onstart="onGlobalAjaxStart()" oncomplete="onGlobalAjaxComplete()" />

The function onGlobalAjaxStart() does the following:

$.blockUI.defaults.overlayCSS = {};
let message = $('#blockUI').attr('pt:message'); // gets the text for the blockUI message
$.blockUI({ message: message});

The function onGlobalAjaxStart() calls $.unblockUI() (among others).

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda