• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Populate Dropdowns

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to populate a dropdown from database using rpc (Async). The problem is the page gets download and dropdown does not get populated, but it has the values.

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 someone helpme on this

Thanks
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The problem is the page gets download and dropdown does not get populated, but it has the values.


This is a little bit of contradictory as well as confusing.
Could you please explain what you mean by
1) page gets downloaded (Downloaded as on to the disk?)
2) dropdown does not get populated, but it has the values
 
rudreshashok kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) page gets downloaded (Downloaded as on to the disk?)
I meant the Page is rendered with empty dropdown values
I had put a debug point on the service layer, that gets called after the page is rendered.

2) dropdown does not get populated, but it has the values
I meant that dropdown does not get populated

I a gist i have a simple html and in the onmoduleLoad method i am trying to populate a dropdown, for now let us say it is Male/Female. This value is a reference data and that comes from database.
I have written a service(ServiceImpl) would query database and result the arrayList, this is been called from gwt client through rpc

ServiceAsync serviceAsync = GWT.create(Service.class)

String[] str = null;
serviceAsync.getMasterData(new AsyncCallback<String[]>()) {

OnFailure{}
OnSuccess (String[] result){
str =result
}

//now populate dropdown.

Some how i felt this will work for onclick events but not onload as this is asynchronous call and will not wait and proceed with executing onmoduleload method

Hope this clarifies

Thanks

 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Where do you populate the list box? You need to double check you are populating the one which you have added to your code and not creating a new one.

Some how i felt this will work for onclick events but not onload as this is asynchronous call and will not wait and proceed with executing onmoduleload method


Did you try it out? What happened?
 
Grow your own food... or this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic