title: What is the simplest way to show "loading indicator" during an RPC call in GWTP?
body: <p>I am using GWTP to build my webapp. Here is my problem. I have a customer page (CustPresenter). When that page is visited, it will call &amp; load Data from Database. </p>
  
  <p>It may take a while to load all data, so I <strong>want my current Browser locked</strong> so that the user can not click any things while data has not finished downloading yet. </p>
  
  <p>So here is what I am thinking. I want to show a DialogBox right before I make the RPC call &amp; hide it when the call finishes. Look at the below code:</p>
  
  <pre><code>public class CustPresenter extends
      Presenter&lt;CustPresenter.MyView, CustPresenter.MyProxy&gt; {
  
      private DialogBox loadingDialogBox=new DialogBox();
  
      @Inject DispatchAsync dispatchAsync;
  
      @Override
      public void prepareFromRequest(PlaceRequest request){
           super.prepareFromRequest(request);
           loadingDialogBox.show();
           GetData getDataAction=new GetData();
           dispatchAsync.execute(getDataAction, getDataCallback);
  
      }
  
      private AsyncCallback&lt;GetDataResult&gt; getDataCallback=new AsyncCallback&lt;GetDataResult&gt;(){
  
          @Override
          public void onFailure(Throwable caught) {
              loadingDialogBox.hide();
          }
  
          @Override
          public void onSuccess(GetVerbFromTripleResult result) {
               //show data here (it may take long time)
               loadingDialogBox.hide();
          }
     };
  }
  </code></pre>
  
  <p>However, when runing, the dialogbox only shows up for 1 second &amp; then disappears. Right After that all the UiBinder Guis show up on the Customer Page &amp; user can click any buttons on the page while the data has not finished downloading yet. This is not a correct behavior.</p>
  
  <p>I want to do something like this <a href="http://sqlfiddle.com/#!2/a2581/1" rel="nofollow">http://sqlfiddle.com/#!2/a2581/1</a>. As u can see, when u first time open that link, a loading panel popups &amp; u can't click anything until all guis show up. </p>
  
  <p>I also tried to make a Custom AsyncCallback, but nothing happened</p>
  
  <pre><code>public abstract class AsyncCall&lt;T&gt; implements AsyncCallback&lt;T&gt; {
  
  
      PopupPanel myp=new PopupPanel();
      /** Call the service method using cb as the callback. */
      public AsyncCall()
      {
          myp.setTitle("loading");
          myp.show();
  
      }
  
      public final void onFailure(Throwable caught) 
      {    
          myp.hide();
  
          onCustomFailure(caught); 
      } 
  
      public final void onSuccess(T result) 
      {       
          myp.hide(); 
  
          onCustomSuccess(result);     
      }
      /** the failure method needed to be overwritte */   
      protected abstract void onCustomFailure(Throwable caught);  
  
      /** overwritte to do something with result */
      protected abstract void onCustomSuccess(T result); 
  
  }
  </code></pre>
  
  <p>So, why do I have this problem?</p>
  
  <p>How to fix it?</p>
  
  <p>Or generally,  What is the simplest way to show "loading indicator" during an RPC call in GWTP?</p>