Re: Update conversation by displaying new messages when they are sent

2016-09-22 Thread Frank
I will repeat myself : I would look into Athmosphere.
This is a wrapper around websockets so you don't have to do the bear bones 
stuff yourself. And they talk about GWT on their Github page 
: https://github.com/Atmosphere/atmosphere-extensions/wiki/Atmosphere-GWT

I used SignalR which is also a wrapper around Websockets, and falls 
automatic back to other stuff if it fails. No GWT support though so I wrote 
my own wrapper in about a day. Another problem for you probably is that 
SignalR needs an IIS server.


Whatever you do : don't use timers !

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-21 Thread Jonathon Lamon
There are several pollyfills for eventsource though.  Just like there are
for older browsers and websockets.

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events

On Wed, Sep 21, 2016 at 7:48 AM Thomas Broyer  wrote:

>
>
> On Wednesday, September 21, 2016 at 4:43:45 PM UTC+2, JonL wrote:
>>
>> Others have suggested websockets, but there are several other options as
>> well.  There is google cloud messaging and many other libraries to solve
>> this problem as well as ServerSent Events.
>>
>> http://www.html5rocks.com/en/tutorials/eventsource/basics/
>>
>
> Unfortunately, and surprisingly, EventSource isn't supported in Microsoft
> browsers, contrary to WebSocket!
> http://caniuse.com/eventsource vs. http://caniuse.com/websockets
>
> If none of those are options, try to avoid using a regular timer.  More
>> timers, more problems.  If you must use a timer like object, I would
>> suggest using gwt Scheduler instead.
>>
>
> Most importantly, schedule the task again from the RPC callback, do not
> schedule a repeating task (in other words, in JS terms, use setTimeout, do
> not use setInterval)
>
>
>> On Tuesday, September 20, 2016 at 2:38:11 AM UTC-7, Olar Andrei wrote:
>>>
>>> Hello,
>>>
>>> In my GWT application I have a messaging system integrated within. When
>>> a specific conversation gets opened, a query runs and selects all messages
>>> available for this conversation. From the same view you can reply to that
>>> conversation. When replying, the other user has to click a small refresh
>>> button (located on top, which agian gets all mesages from the DB running
>>> the same query from above) in order for the last message to appear.
>>>
>>> My question: How can I make that refresh automatically, so you don't
>>> have to click on the button in order to refresh the conversation. Like in
>>> FB, Messenger, etc, where you don't refresh the conversation and the
>>> messages keep coming without you having to do anything.
>>>
>>> Thanks in advance.
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GWT Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/zsyG1NKf2p8/unsubscribe
> .
> 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 https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Jonathon Lamon
Chief Software Engineer
Perceptronics Solutions Inc.
Tel  703-485-2922
Cell 269-205-4649
www.percsolutions.com

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-21 Thread Thomas Broyer


On Wednesday, September 21, 2016 at 4:43:45 PM UTC+2, JonL wrote:
>
> Others have suggested websockets, but there are several other options as 
> well.  There is google cloud messaging and many other libraries to solve 
> this problem as well as ServerSent Events.
>
> http://www.html5rocks.com/en/tutorials/eventsource/basics/
>

Unfortunately, and surprisingly, EventSource isn't supported in Microsoft 
browsers, contrary to WebSocket!
http://caniuse.com/eventsource vs. http://caniuse.com/websockets

If none of those are options, try to avoid using a regular timer.  More 
> timers, more problems.  If you must use a timer like object, I would 
> suggest using gwt Scheduler instead.
>

Most importantly, schedule the task again from the RPC callback, do not 
schedule a repeating task (in other words, in JS terms, use setTimeout, do 
not use setInterval)
 

> On Tuesday, September 20, 2016 at 2:38:11 AM UTC-7, Olar Andrei wrote:
>>
>> Hello,
>>
>> In my GWT application I have a messaging system integrated within. When a 
>> specific conversation gets opened, a query runs and selects all messages 
>> available for this conversation. From the same view you can reply to that 
>> conversation. When replying, the other user has to click a small refresh 
>> button (located on top, which agian gets all mesages from the DB running 
>> the same query from above) in order for the last message to appear.
>>
>> My question: How can I make that refresh automatically, so you don't have 
>> to click on the button in order to refresh the conversation. Like in FB, 
>> Messenger, etc, where you don't refresh the conversation and the messages 
>> keep coming without you having to do anything.
>>
>> Thanks in advance.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-21 Thread JonL
Others have suggested websockets, but there are several other options as 
well.  There is google cloud messaging and many other libraries to solve 
this problem as well as ServerSent Events.

http://www.html5rocks.com/en/tutorials/eventsource/basics/

If none of those are options, try to avoid using a regular timer.  More 
timers, more problems.  If you must use a timer like object, I would 
suggest using gwt Scheduler instead.

On Tuesday, September 20, 2016 at 2:38:11 AM UTC-7, Olar Andrei wrote:
>
> Hello,
>
> In my GWT application I have a messaging system integrated within. When a 
> specific conversation gets opened, a query runs and selects all messages 
> available for this conversation. From the same view you can reply to that 
> conversation. When replying, the other user has to click a small refresh 
> button (located on top, which agian gets all mesages from the DB running 
> the same query from above) in order for the last message to appear.
>
> My question: How can I make that refresh automatically, so you don't have 
> to click on the button in order to refresh the conversation. Like in FB, 
> Messenger, etc, where you don't refresh the conversation and the messages 
> keep coming without you having to do anything.
>
> Thanks in advance.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-20 Thread natan clara

  
  
Make a timer that fires every X seconds.

Button refresh = new Button();
  Time temporizador = new Timer() {
  
      @Override
      public void run() {
      dispara();
      }
  };
  // 2 seconds
  temporizador.scheduleRepeating(2000);
  
  
  private final void dispara() {
      refresh.setFocus(true);
      refresh.fireEvent(new GwtEvent() {
      @Override
      protected void dispatch(ClickHandler handler) {
      handler.onClick(null);
      }
  
      @Override
      public
  com.google.gwt.event.shared.GwtEvent.Type
  getAssociatedType() {
      return ClickEvent.getType();
      }
      });
  }


Natan.

Em 20/09/2016 07:40, David escreveu:


  If you only need to support modern browsers then I
really would go the WebSockets way. Its really simple to
implement with JSInterop. I did so in combination with GWT
Jackson and RequestBuilder. On the server side I used Jersey.
Unfortunately I cannot publish this code since it is closed
source.
  
  
On Tue, Sep 20, 2016 at 12:16 PM Frank 
  wrote:


  I do this using signalR (for which I built a
GWT wrapper (not opensource).

But maybe you should look into websockets or atmosphere
  (which uses websockets).
  
  -- 
  You received this message because you are subscribed to the
  Google Groups "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
  For more options, visit https://groups.google.com/d/optout.

  
  -- 
  You received this message because you are subscribed to the Google
  Groups "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
  For more options, visit https://groups.google.com/d/optout.


  




-- 
You received this message because you are subscribed to the Google Groups "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-20 Thread David
If you only need to support modern browsers then I really would go the
WebSockets way. Its really simple to implement with JSInterop. I did so in
combination with GWT Jackson and RequestBuilder. On the server side I used
Jersey. Unfortunately I cannot publish this code since it is closed source.

On Tue, Sep 20, 2016 at 12:16 PM Frank  wrote:

> I do this using signalR (for which I built a GWT wrapper (not opensource).
>
> But maybe you should look into websockets or atmosphere (which uses
> websockets).
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-20 Thread Frank
I do this using signalR (for which I built a GWT wrapper (not opensource).

But maybe you should look into websockets or atmosphere (which uses 
websockets).

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Update conversation by displaying new messages when they are sent

2016-09-20 Thread Vassilis Virvilis
Simplest solution a timer that polls the DB every 10sec let's say.

If you want a truly asynchronous server side notification you should look
at websockets or long polling...

Vassilis

On Tue, Sep 20, 2016 at 12:38 PM, Olar Andrei  wrote:

> Hello,
>
> In my GWT application I have a messaging system integrated within. When a
> specific conversation gets opened, a query runs and selects all messages
> available for this conversation. From the same view you can reply to that
> conversation. When replying, the other user has to click a small refresh
> button (located on top, which agian gets all mesages from the DB running
> the same query from above) in order for the last message to appear.
>
> My question: How can I make that refresh automatically, so you don't have
> to click on the button in order to refresh the conversation. Like in FB,
> Messenger, etc, where you don't refresh the conversation and the messages
> keep coming without you having to do anything.
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.