Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Showing a Waiting prompt message on client side events

    Hi
    I want to know if there is a feature which can show waiting prompt message on client side events. For Example when the user clicks a button on which some components are hidden/shown the used should be show a prompt saying "Wait...". I tried some thing like this:
    Code:
    button.addClickHandler{
        new ClickHandler
        {
            public void onClick
             {
                 SC.showPrompt("Wait.......");
                 ......................................
    
    
    
    
    
    
               ....................................
                SC.clearPrompt();
              }
        }
    }
    But doing the above did not show the prompt at all. Can anyone please tell me the reason behind this and also how to achieve this.


    Thanks
    Kiran

    #2
    It does work, it probably happened so fast you missed it. If your code in between the SC calls is minimal you'll never seen the prompt on a modern computer.

    If you don't believe me try this code:
    Code:
    public void onModuleLoad() {
      IButton b = new IButton("Click Me");
      b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          SC.showPrompt("Wait...");
          Timer t = new Timer() {
            @Override
    	public void run() {
    	  SC.clearPrompt();
    	}
       };
       t.schedule(1000);
    }
    });
    b.draw();
    }
    Last edited by svjard; 1 Jun 2010, 07:53.

    Comment


      #3
      Thanks svjard...
      you are right. I was trying to put a status component on the client side (like I have a tree grid with data on client side (not from data source) and many nodes so when I am expanding a folder with many leaf nodes it is taking some time to expand and show all the nodes. So I though of showing and clearing the prompts so as to show the user the waiting status. But the events are very fast that the status doesn't even appear. But the browser takes some time to render and show all the nodes. Any Idea how to show this status to the user).
      But your reply helped me a lot.

      Thanks
      Kiran

      Comment


        #4
        How many nodes are we talking about here? It would have to be pretty massive for it take a long time. Do you have animation turned off? I would look at ways to optimize the behavior your seeing first, then move to showing a prompt of some kind.

        Comment

        Working...
        X