1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    129
    Vote Rating
    0
    blay is on a distinguished road

      0  

    Default About async calls

    About async calls


    Hello:

    I know this is more a GWT question, but I´ll appreciate any idea about this issue. Of course, I´ve posted this on GWT forums too.

    I´m building a webapp which, depending on the user, will show some options on the menu or other ones. For doing this, I invoke a Single Singed On method passing as arguments, the user and the application and getting as return value a string identifying the "role" of the user. As I´m using GWT, I can´t invoke the SSO method from the client side, so I have to make a RPC to the server, which will invoke the method and return the "role" to the client.
    I do all of this before "start creating the widgets that will be showed", but I face the problem of asyncronous calls.
    I invoke the RPC, but the return value may come late (by late I mean when it has already started "building the widgets and appearance of the web application".
    The only solution I see (and I don´t know if it´s correct or even possible) is start the building part in the body of "onSuccess(String result)" method, of the callback method associated to the RPC call.

    I don´t know if I explanied it right...but I hope so.



    Thanks

  2. #2
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    867
    Vote Rating
    1
    micgala is on a distinguished road

      0  

    Default


    Well, since you need to wait for the result of that method, returning the role, for building your UI, then yes, you need to build your ui just after the onsuccess returns.

    You can do this by adding the ui building stuff in the onsucess method, or, by creating some kind of listener (which is more elegant).

  3. #3
    Sencha User
    Join Date
    Oct 2010
    Posts
    129
    Vote Rating
    0
    blay is on a distinguished road

      0  

    Default


    First of all, thanks for ur answer

    Where do you mean to create a listener? Sorry, but im new to this and I don´t get it all. Could you explain it a bit more? a small example?

    thx

  4. #4
    Sencha User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    867
    Vote Rating
    1
    micgala is on a distinguished road

      0  

    Default


    I mean that, the class that build your ui, could be/have a listener.
    A listener to the role string.

    And, in case the role is retrieved by the class that gets the role, then it should fire an event for the roleListeners... notifying that the role was received.

    But, anyway, that is just for elegance... probably, as for now, you could simply start building the ui in the onSuccess method...

Similar Threads

  1. Async tree calls load twice
    By clavinovahan in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 2 Jun 2010, 1:19 AM
  2. Replies: 7
    Last Post: 21 Jan 2007, 5:57 PM
  3. Loading Async'ly
    By techno_adi in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 6 Oct 2006, 3:37 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar