I am doing an project on Java and GWT and stuck in one part I want to create a reminder that is like user enters date and time and at that time a pop up should be displayed reminding user of his event. Can anyone suggest me any approach towards achieving this.
When I googled for the solution i found some stuff related to timers in GWT but I guess timer has method schedule()
which takes milliseconds as parameter but converting date and time into milliseconds doesn't seem the solution so any other alternative is highly appreciated.
You can't handle it with only timers. Seems that you need to implement some server side logic to achieve this.
Notifying the user could be achieved by several ways:
Simple polling
- ask server from client what events happened since last check every N (let't say 10) seconds, using Ajax calls. Server needs to compare current time and send events list back to the client
Long poll
or Hidden Iframe
to be used for pushing the events to the client - more complex, but also could be implemented
You can also take a look at GwtEventService to manage your events between server and client.
Finally your logic stays simple - client needs to listen from the server about happened events and to show pop up dialog in the handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With