Monday, December 24, 2012

Re: dynamic update data

On 12/24/2012 3:48 AM, Aldin Habibović wrote:
Hi guys,

I am developing pizza ordering application. I have two forms:

1) For inserting new pizza
2) and for ordering.

Here you can see:




When I insert a new pizza and go to check on combo box (picture ordering) I can't see my new pizza in combo box. The new pizza is inserted in my databases. The pizzas in combo box are from my database.

I have one idea.  But I don't think it is good. To use

    Timer t = new Timer() {        public void run() {          //display all pizza from my database every 2 se to combobox        }      };
t.schedule(2000);    
Any idea for better approach???  
Thanks  

That's certainly one approach. There's nothing inherently wrong with polling. The interval will depend on your specific requirements.
If this is a classroom exercise, then it would be good to explore other models, some of which are available in the GWT universe.
A search of the list archives on publish/subscribe and push models will be rewarding.

No comments:

Post a Comment