Search code examples
primefacesprimefaces-extensions

pe:blockUI how to disable fade effect?


I am using the Primefaces Extensions BlockUI component for global ajax events like this:

<p:ajaxStatus onstart="PF('globalBlockUI').block({ fadeIn: 0 })" onsuccess="PF('globalBlockUI').unblock({ fadeOut: 0 })"/>

<pe:blockUI id="globalBlockUI" widgetVar="globalBlockUI"
            css ="{}"
            cssOverlay="{}">
...
</pe:blockUI>

I would like to disable the fade effect. Setting the {fadeIn: 0} option like in JQuery seems to be ignored.

How do I disable the fade effect?


Solution

  • Try adding this to your page...

    <script type="text/javascript">
       $.blockUI.defaults.fadeIn = 0;
    </script>
    

    I have also created this ticket so those attributes get added as first class citizens on the component itself: https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/594

    UPDATE: I have committed a fix for the above GitHub ticket. So you will be able to do...

    <pe:blockUI id="globalBlockUI" fadeIn="0" fadeOut="0"/>