# Barra de progreso y bloqueo para procesos muy largos

![](/files/-Lk-d791lQU7ejDMgwDy)

Para procesos muy largos podemos invocar un dialogo que muestre que se esta procesando y bloquear el panel  hasta que termine la operación.

```markup
 <p:ajaxStatus onstart="PF('jmoordbjsfStatusDialog').show()" onsuccess="PF('jmoordbjsfStatusDialog').hide()" />
        <p:dialog widgetVar="jmoordbjsfStatusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
            <p:outputLabel value="Procesando...."/>
            <i class="pi pi-spin pi-spinner" style="font-size: 2em"></i>
        </p:dialog>
```

Usamos el ajaxStatus de esta manera cada componente que use un Ajax mostrara el dialogo mientras se ejecuta el proceso, Aplica automaticamente para autocomplete, selecteOneMenu y todos los componentes que usen ajax.

El bloqueo se hace indicando el componente que invoca la operacion, generalmente un commandbutton identificado por su id y el componente a bloquear.

```markup
    <p:blockUI block="mypanel" trigger="jmoordbjsfCommandButtonSave" />
```

|   |   |
| - | - |
|   |   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/trucosjakartaee/overview/java-server-faces/barra-de-progreso-y-bloqueo-para-procesos-muy-largos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
