Re: Populate Dropdowns
You can try something like this:
ListBox box = new ListBox();
box.setEnabled(false);
box.addItem("loading...");
service.getData(new AsyncCallback{public void onSuc(loadData(result));
public void loadData(ArrayList<Data> list){
box.clear();
for(Data d:list){
box.addItem(d.getName());
}
box.setEnabled(true);
}
basically just add the SingleSelect ListBox to the UI with a message
to the user and disable it
then when the request returns, clear the box, enable it, and add items
Maybe your problem isn't that easy though...
On Jun 10, 10:11 am, rudresh <rudresh...@gmail.com> wrote:
> Hi All,
>
> I am trying to populate a dropdown from database using rpc (Async) in
> OnmoduleLoad. The problem is the page gets rendered and dropdown does
> not get populated, but it has the values, i had tried printing the
> size.
>
> I believe the approach that i took is incorrect, it should not be
> Async, but again i did not find any other way to call the service from
> gwt client.
>
> Can i know what is the best way to populate the dropdowns
>
> Can someone helpme on this
>
> Thanks
--
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