1

I have a p:dataTable which has a column which has p:commandButtons which performs a specific action against that row, that action goes off does a number of things and then navigates to a different page. As it takes a few seconds to do those things I'd like to make it obvious to the user that something is happening, so I'm attempting to use a p:blockUI like so

<h:form id="myForm">
    <p:dataTable ...>
        <p:column>
            <p:commandButton onclick="bui.show()" oncomplete="bui.hide()" .../>
        </p:column>
    </p:dataTable>
</h:form>
<p:blockUI widgetVar="bui" block="myForm"/>

The blockUI doesn't show however, is there something wrong with the approach above?

PDStat
  • 5,513
  • 10
  • 51
  • 86

1 Answers1

2

As I know you can't call for blockUI with a widgetVar like that.

The correct way is this: PF('widgetVar').method;.

In your case: PF('bui').show(); and PF('bui').hide();

You can read more here: Intro To PrimeFaces widgetVar.

X-spert
  • 264
  • 2
  • 11
  • Perfect thank you! The answer I was basing my code on was misleading, perhaps due to different versions of primefaces – PDStat Sep 30 '16 at 10:09