Hi,

I am developing an application using GWT 1.6.4. So for my project I
have the following client interface and classes.

MyProject - onModuleLoad loading a suggest box
MyProjectService - interface to define a method to get roles
MyProjectServiceAsync - interface for the asynchronous method of
getting roles.

and the server side class is MyProjectServiceImpl. I am getting roles
from a database using web service calls which returns around 150
roles.

In MyProject.java, whatever roles I get from MyProjectServiceImpl I
put in the suggest box.

My problem now is

1) when I access the page and let say write any letter, nothing
happens. Then I do a backspace and put another letter, I see the
results.
2) when I access the page and wait for 10-15 sec and the put a letter,
I am getting the result.

The way I am implementing the Suggest Box is something wrong I
suspect.

My MyProject.java code

private final MyProjectServiceAsync  selfUIService = GWT.create
(MyProjectService.class);
private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
private final SuggestBox myRoleSuggestBox = new SuggestBox(oracle);
myRoleSuggestBox.setLimit(10);
RootPanel.get("roleSearchField").add(myRoleSuggestBox);

//the method call now

selfUIService.getMyRoles(userId, new AsyncCallback<List<String>>() {
        public void onFailure(Throwable caught) {

        }

        public void onSuccess(List<String> roles) {
                displayRoles(roles);
        }
});

private void displayRoles(List<String> rolesList) {
        if(rolesList != null && !rolesList.isEmpty()) {
                int rolesListSize = rolesList.size();
                if(rolesListSize != 0){
                        oracle.addAll(rolesList);
                }
        }
}

Will appreciate if anybody can throw any suggestion.

Thanks,
Rajeeb

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to