GWT Reminder

I am doing a Java and GWT project and are stuck in one part. I want to create a reminder reminding that the user enters a date and time, and at this time a pop-up reminder of the user about his event should appear. Can anyone suggest me some approach to achieve this.

When I googled for a solution, I found some things related to timers in GWT, but I think the timer has a schedule() method that takes milliseconds as a parameter, but converting date and time in milliseconds doesn't seem to be a solution, so any other alternative highly appreciated.

+6
source share
1 answer

You cannot process it only with timers. It seems you need to implement some server-side logic to achieve this.

  • The user selects the time and date for the event on the client → a server call to store it somewhere (there may be a simple RPC or Ajax call)
  • User notification can be achieved in several ways:

    • Simple polling - ask the server from the client what events have occurred since the last check every N (say, 10) seconds using Ajax calls. The server needs to compare the current time and send the list of events back to the client

    • Long poll or Hidden Iframe , which will be used to click events on the client - more complex, but can also be implemented

You can also look at the GwtEventService for event management between the server and the client.

Finally, your logic remains simple - the client must listen to events from the server and display a pop-up dialog box in the handler.

+4
source

All Articles