Re: Synchornous GWT, how can i do that

2009-03-12 Thread Magius
I've had the same problem some months ago. I was developping a big application for a telco enterprise and most of the application forms requiered loading several fields at the same time during initialization. For example, the "create a route between servers" form requieres to load several drop-dow

Re: Synchornous GWT, how can i do that

2009-03-12 Thread alex
Why do you need sync`ed method calls? I think that you actually need a way to find out when a RPC call has returned (either one of onSuccess / onFailed). One way to go with this is to have a simple event system where events are thrown when changes are made - these changes can be UI modifications,

Re: Synchornous GWT, how can i do that

2009-03-11 Thread jmpeace
Please take a took to this code I have written this code to be able to make RPC calls one after another: (you can use 'result' value to know if you can continue to next call) /*ONE*/CustomWaitingOperation.execute(new CustomWaitingOperation.ResultCallback(){ public void onResult(boolean r

Re: Synchornous GWT, how can i do that

2009-03-11 Thread Vitali Lovich
It's not really a matter of this being GWTs way. I believe this is the only thing browsers support since they do not have multiple threads, at least so that the UI doesn't lock up. And by UI lockup, I don't mean the page is unresponsive - I mean the whole browser used to freeze if a page was in a

Re: Synchornous GWT, how can i do that

2009-03-11 Thread eggsy
I agree with all the previous posts that Asynchronous is the best way and that is why GWT only implements this. When I started with GWT I was asking a similar question and was correctly advised to think in terms of Async not Sync the more development you do with GWT you'll realise this. However

Re: Synchornous GWT, how can i do that

2009-03-11 Thread ping2ravi
I totally agree with you guys that Asynchronous is good, but i would love to see mix up of synchrnous and asynchronous in GWT(my personal view), where i can make an asynchronous call to one function which internally can make synchronous calls and it will solve the problem of UI hanging.(In case GW

Re: Synchornous GWT, how can i do that

2009-03-11 Thread al0
"How much extra code is too much?" - single line of (unnecessary) extra code is way too much. On Mar 10, 6:01 pm, mikedshaffer wrote: > Lothar's original suggestion > > "Do the UI-update in a method called updateUI where you check if all > necessary data (e.g. above lists) are present and call t

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Matías Costa
On Tue, Mar 10, 2009 at 6:01 PM, mikedshaffer wrote: > Lothar's original suggestion > > "Do the UI-update in a method called updateUI where you check if all > necessary data (e.g. above lists) are present and call this method > in every onSuccess-method of the different AsyncCallback-classes. " >

Re: Synchornous GWT, how can i do that

2009-03-10 Thread mikedshaffer
Lothar's original suggestion "Do the UI-update in a method called updateUI where you check if all necessary data (e.g. above lists) are present and call this method in every onSuccess-method of the different AsyncCallback-classes. " is the way to go. How much extra code is too much? You have 5

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Jason Essington
Actually from a user's point of view, hanging the UI is NEVER acceptable even if it is for less than a second. In the case of waiting for a couple of seconds, depending on the browser and version, you cannot change tabs, cannot close the browser or anything. This is a VERY NAUGHTY thing to

Re: Synchornous GWT, how can i do that

2009-03-10 Thread ping2ravi
Lothar, good point but i think that's the beauty of GWT code, they already have one parameter(timeoutMillis) in following call( i have not tested it, if it works or not but i guess it will work.) Request request = new Request(xmlHttpRequest, timeoutMillis, callback); So if call doesnt get fi

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Ian Bambury
You said you didn't want to chain calls. If you make more than 2 calls to the server, then the 3rd one onwards will be delayed. The quickest and most efficient way is to do the work on the server in one call. The maintenance is no different, in fact it is easier, since you don't have to bother wit

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Lothar Kimmeringer
ping2ravi schrieb: > Do you see any problem in having synchronous calls.? except that it > may hang the UI for a second and that is acceptable. If the server is not available or the request get lost for some other reason, the UI of the browser hangs for a couple of minutes and not seconds. Reg

Re: Synchornous GWT, how can i do that

2009-03-10 Thread ping2ravi
Ian, That is not an option for me, creating such API is not a good idea from application maintenance as well as architect point of view. Lothar, Your suggestion sounds good and i can use it where i need to update the UI, but what about if condition if(IsUserloggedIn()) { callApi1() callApi2() } e

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Ian Petersen
Synchronous RPC is a tremendously bad idea. Read this for more insight: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/faca1575f306ba0f/3be719c021aa19bd The way I have addressed some of the problems you mention is with an event-based model. For example, to display the r

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Lothar Kimmeringer
ping2ravi schrieb: > 1) Check if user is logged in > 2) Get Some data List list1 e.g. getUserAddresses > 3) Get some data List list2 e.g. getUserFriends > 4) Get Some data List List3 e.g. getUserCommunities > 5) now create the UI based on above data retrieved. Now as all GWT RPC > calls are

Re: Synchornous GWT, how can i do that

2009-03-10 Thread Ian Bambury
Do it on the server. Make one request, check the user is logged in, get list1, get list2, get list3, return. In the callback, process what you get. Ian http://examples.roughian.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Synchornous GWT, how can i do that

2009-03-10 Thread ping2ravi
HI All GWT Experts, Its long time i have been looking for some Synchronous way of making RPC calls in GWT. Whenever its just one call to server, writing code is not pain. But lets say, to initiate one component i need to make following calls. 1) Check if user is logged in 2) Get Some data List li