On 03/22/2013 03:04 AM, Kris wrote:
Hi, When is the onReset method called.. ??

In my case I have an ListBox I want to put in some values at startup...
so the data is there when the user loads the page.

The data is in the database, and I want to retrieve the data through a
SessionBean ( using JBoss )



On Thursday, March 21, 2013 10:06:32 AM UTC-7, Kris wrote:

    Hi, I am trying to load some data for a ListBox on startup..

    I have this in the onModuleLoad method

    private final PrintProviderMockServiceAsync ppmockService =
    GWT.create(PrintProviderMockService.class);
    ....
    ....

    ppmockService.getPrintProviders(new
    AsyncCallback<ArrayList<PrintProviderMock>>() {

    @Override
    public void onSuccess(ArrayList<PrintProviderMock> arg0) {
    for (PrintProviderMock printProviderMock : arg0) {
    comboBox..addItem(printProviderMock.getName());
    }
    }

    @Override
    public void onFailure(Throwable t) {
    t.printStackTrace();
    }
    });

    Anyone got some good ideas how to load data into various widgets on
    startup ??


--
You received this message because you are subscribed to the Google
Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to
[email protected].
To post to this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



In my case I like to separate the "data layer" from the "presenter layer" so its up to you how you retrieve your data, but for sure it will be "ajax" underneath (for RPC or the same sort)

The onReset() get execute when the page loads...

So when you go to the page that will render that list, it will first fetch data, in your case via RPC, then push the data to the view, then the view will be displayed. I think all MVP framework works this way...

Perhaps you can look at this code: http://bit.ly/YIBxuQ

This implements a full MVP application, with code simple enough for you to grasp the concept.

The live version of that code is here: http://touch4j.appspot.com/





--
You received this message because you are subscribed to the Google Groups "Google 
Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to