My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
RunAsync  
RunAsync overview
Updated Aug 19, 2010 by gal.dol...@gmail.com

Introduction

@RunAsync is another extension of the event binding system.

It gets your handler called with GWT.runAsync. This way you can get granular control over the code splitting.

Another way to split your code is making your places @RunAsync (see PlaceManager).

Example:

    @ViewHandler
    @RunAsync // Simply adding this will get this whole method async 
    protected void deleteButton$click() {
        List<ContactDetails> selectedContacts = selectionModel.getSelectedItems();

        int size = selectedContacts.size();
        String[] ids = new String[size];
        for (int i = 0; i < size; ++i) {
            ids[i] = selectedContacts.get(i).getId();
        }

        commandService.execute(new DeleteContactAction(ids), new AbstractAsyncCallback<DeleteContactResponse>() {
            @Override
            public void success(DeleteContactResponse result) {
                contactDetails = result.getContacts();
                sortContactDetails();
                view.setRowData(contactDetails);
            }
        });
    }
Powered by Google Project Hosting