Saturday, November 13, 2010

How to handle the async callback event to update the GUI

Hi

I use the following code to retrieve data and load the data to CatWidget; then, update the CategoryContainer.

I use the RPC in the constructor of CatWidget.
It doesnt seem quite right because the instance assignment may faster than database retrieval.

How should I modify the code if my concept is incorrect?


public class CategoryContainer extends HorizontalPanel
{
private void init()
{
CatWidget tmpWidget = new CatWidget(1); <--Use RPC to retrieve database
catWidgetAry.add(tmpWidget);
//redraw all items in catWidgetAry
this.refresh();
}

}

public class CatWidget
{
CatWidget(int _oid)
{
//Use RPC AsyncCallback to load the Widget from database
}
}

Thanks a lot


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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate