yeah thats what i was doing but knew i could do the first 2 calls concurrently to improve the loadup speed and with this flag aproach i think i have achieved that rather effectively.
The HTML idea is nice sugestion but the first 2 calls were to get a list of departments and the users details from windows Active Directory. Not easy with static HTML ;-) On Dec 18, 2:23 pm, "Arthur Kalmenson" <arthur.k...@gmail.com> wrote: > That is the normal way of chaining RPC calls, i.e. making the next > call from the callback of the previous call. The loading time of your > application shouldn't depend on the RPC returning unless you build > your UI after all 3 RPCs return. In that case, it's possible to embed > data in the HTML file itself and read that in from GWT so you can have > some initial data to start with. > > -- > Arthur Kalmenson > > On Thu, Dec 18, 2008 at 5:40 AM, stephen.sm...@paretopartners.com > > > > <stephen.sm...@paretopartners.com> wrote: > > > sorry i confused myself. tht should of been: > > > if(OtherCallHasReturned) { > > //make 3rd call > > } else { > > OtherCallHasReturned = true; > > } > > > This still isnt great as the callbacks wont execute untill after the > > onModule load has completed and the thread returns to main however it > > is still a very crude way of blocking on multiple RPC calls > > > On Dec 18, 10:36 am, "stephen.sm...@paretopartners.com" > > <stephen.sm...@paretopartners.com> wrote: > >> Just had a brilliant idea if anyones interested. > > >> Put the call to the 3rd rpc method in BOTH the return statements of > >> the 1st and second. and only execute them if they havent allready been > >> executed. > > >> if (!triggered3rdRPCcall) { > >> triggered3rdRPCcall = true; > >> doThe3rdRPCcall(); > > >> } > > >> Again it aint pretty but it should improve performance. > > >> Has anyone got any better surgestions? > > >> On Dec 18, 10:14 am, "stephen.sm...@paretopartners.com" > > >> <stephen.sm...@paretopartners.com> wrote: > >> > Firstly, before any1 goes off on 1 about "You cant do syncronous rpc > >> > calls in gwt" or "JS is single threaded" im fully aware of these > >> > facts. However i also know that like many things there are usually > >> > work arounds or at least better solutions than i have thought of... > > >> > So my problem is this. I have 3 RPC calls. The first 2 are totally > >> > seperate however the third depends on the result of both the first 2. > > >> > The 3rd call is unfortunately rather large as it requires some DB > >> > access on the server and sorting/filtering etc. and i would therefor > >> > like to get this going asap. > > >> > There is also alot of other initalisation code on the client that can > >> > be done at almost any stage. so it would be preferable to do this > >> > during any (and possibly all) of the rpc calls > > >> > This is all currently done in module load and i am chaining my 3 rpc > >> > calls. This causes the total load time to be a bit slow. This seems > >> > such a horrible way to do it and even for me it gets a little > >> > confusing and i wrote it. > > >> > Does any one have a better solution to how i can "wait" on the first 2 > >> > calls before making the 3rd whilst still executing the client > >> > initalisation code. > > >> > Thanks in advance, > >> > Steve- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---