Re: RPC call in Activity onStop()

2013-03-05 Thread yves
The use case is when one is closing the browser or the tab or when 
navigating to another url, thus really quitting the GWT application, not 
just changing Place.
I found that apparently in this case the 
ActivityManager.onPlaceChange(PlaceChangeEvent event) seems to be never 
called.
And then onStop() is NOT called in my use case.

Yves

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-03-05 Thread Milan Cvejic
Hey Yves,
maybe you can hook and listen on PlaceChangeEvent. That event actually
calls onStop(). So if that event is fired than you can execute your RPC
call.

Best,
Milan

On Tue, Mar 5, 2013 at 8:10 PM, yves  wrote:

> Hi,
>
> Finally I didn't succeed to make an RPC call from the overridden
> AbstractActivity.onStop().
> Actually the GWT doc says about onStop() : "Called when the Activity's
> widget has been removed from view".
> I guess that all the RPC mechanisms is already destroyed because the
> server never get called.
>
> @Milan : I can't make the call during mayStop because I don't know at that
> moment whether the user will choose to close or not the activity. The RPC
> call must be executed only when the activity is effectively stopped.
>
> The only ugly workaround I found is a kind of watchdog between the client
> and the server so that the client periodically tells to the server "I am
> still here".
>
>
> If someone succeeded to make an RPC call during onStop(), I would
> appreciate the feedback :-)
>
> Yves
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/qQ3s-u6XEBs/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
>
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-03-05 Thread yves
Hi,

Finally I didn't succeed to make an RPC call from the overridden 
AbstractActivity.onStop().
Actually the GWT doc says about onStop() : "Called when the Activity's 
widget has been removed from view".
I guess that all the RPC mechanisms is already destroyed because the server 
never get called.

@Milan : I can't make the call during mayStop because I don't know at that 
moment whether the user will choose to close or not the activity. The RPC 
call must be executed only when the activity is effectively stopped.

The only ugly workaround I found is a kind of watchdog between the client 
and the server so that the client periodically tells to the server "I am 
still here".


If someone succeeded to make an RPC call during onStop(), I would 
appreciate the feedback :-)

Yves

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-02-21 Thread Milan Cvejic
Try to send request in mayStop method. It may work as widget is still not 
destroyed nor deatached.

On Thursday, February 21, 2013 10:14:37 PM UTC+1, yves wrote:
>
> Actually it is a subclass of AbstractActivity and onStop() is overridden.
> The fact the widget is being destroyed (? I am not sure of what really 
> happens at this moment) could be the source of the problem because I have a 
> lot of things to do during the onStop() call and something might go wrong 
> in the client.
> Thanks for input.
> Yves
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-02-21 Thread yves
Actually it is a subclass of AbstractActivity and onStop() is overridden.
The fact the widget is being destroyed (? I am not sure of what really 
happens at this moment) could be the source of the problem because I have a 
lot of things to do during the onStop() call and something might go wrong 
in the client.
Thanks for input.
Yves

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-02-21 Thread yves
Sorry for my late reaction.
Indeed I don't need the callback, I just need to send a "terminates" 
message to the server to release some temporary work data.
As it didn't worked, I removed this part of the code, so I can't give right 
now an example. But the fact is that the server didn't received the call 
(checked with a lot of debug logs and breakpoints).
I'll try again, also with the addClosingHandler() which I didn't knew.
Thanks for the suggestion.
I'll come back soon.
Yves

Le mardi 19 février 2013 23:45:32 UTC+1, Jens a écrit :
>
> I don't see why it should not work. You can do an RPC request in 
> Activity.onStop() but you have to be aware of the fact that the activity 
> will continue to stop while the request is pending. So your request's 
> callback should not do anything that depends on the activity state or its 
> view (which will be detached after the activity is stopped).
>
> You can also do a RPC request in Window.addClosingHandler() which will be 
> called before the window/tab gets closed. But again in this case the 
> callback is probably never called as the window/tab gets closed while the 
> request is pending. All you could do here is telling the server that the 
> app "terminates" now and let the server invalidate the users session for 
> example.
>
> Have you checked FireBug/Chrome Devtools and verified that no last request 
> is made?
>
> -- J.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-02-19 Thread K vfdsdfbsdb
hi.

do you use onStop of Activiti interface?
if you use it, it is call when it's wiget is clised.
 2013/02/18 7:47 "yves" :

> Hi,
>
> After a search on the net I didn't find an answer to this problem : I need
> to make an RPC call from the onStop() function in order to inform the
> server that the application is closing.
>
> Apprently this doesn't work : the server never gets RPC-called from
> onStop(). (I checked that onStop is called...)
>
> Thus my questions are :
> 1) Is it really impossible to make an RPC call during the onStop process ?
> 2) In case it is impossible, is there any way to know that the app is
> closing so I can make a last RPC call ?
>
> Thank you for your suggestions.
> Yves
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-02-19 Thread Jens
I don't see why it should not work. You can do an RPC request in 
Activity.onStop() but you have to be aware of the fact that the activity 
will continue to stop while the request is pending. So your request's 
callback should not do anything that depends on the activity state or its 
view (which will be detached after the activity is stopped).

You can also do a RPC request in Window.addClosingHandler() which will be 
called before the window/tab gets closed. But again in this case the 
callback is probably never called as the window/tab gets closed while the 
request is pending. All you could do here is telling the server that the 
app "terminates" now and let the server invalidate the users session for 
example.

Have you checked FireBug/Chrome Devtools and verified that no last request 
is made?

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RPC call in Activity onStop()

2013-02-19 Thread yves
Not any suggestion ?
Thanks
Yves

Le dimanche 17 février 2013 23:47:12 UTC+1, yves a écrit :
>
> Hi,
>
> After a search on the net I didn't find an answer to this problem : I need 
> to make an RPC call from the onStop() function in order to inform the 
> server that the application is closing.
>
> Apprently this doesn't work : the server never gets RPC-called from 
> onStop(). (I checked that onStop is called...)
>
> Thus my questions are :
> 1) Is it really impossible to make an RPC call during the onStop process ?
> 2) In case it is impossible, is there any way to know that the app is 
> closing so I can make a last RPC call ?
>
> Thank you for your suggestions.
> Yves
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




RPC call in Activity onStop()

2013-02-17 Thread yves
Hi,

After a search on the net I didn't find an answer to this problem : I need 
to make an RPC call from the onStop() function in order to inform the 
server that the application is closing.

Apprently this doesn't work : the server never gets RPC-called from 
onStop(). (I checked that onStop is called...)

Thus my questions are :
1) Is it really impossible to make an RPC call during the onStop process ?
2) In case it is impossible, is there any way to know that the app is 
closing so I can make a last RPC call ?

Thank you for your suggestions.
Yves

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.