Search code examples
javagwtsmartgwtgwt-ext

GWT loading elements dynamically on page load


I have some page that should have dynamic count of check boxes, and inputs depends on data received from database

now I do like this:

  1. make rpc call on component load (getting data for inputs)
  2. onSuccess add inputs dynamically on the form

result: form displayed without content(because it makes call async), only after resizing, it displays content properly (probably I can fire resize event or redraw with my self, don't know how.. )

question: I am new in GWT, What is the best way to do this task? (Now i am using gwt-ext http://gwt-ext.com/, but I think it's no matter )

update: to refresh panel it's possible to call doLayout();


Solution

  • I'm not familiar with gwt-ext but in "vanilla" gwt you have two options:

    1. Refresh your widget (that should show the result) in the onSuccess method
    2. Proceed with the rest of your code not until the result returned.

    To get a bit more precise i would need more of your code.