public class MyDbOracle extends SuggestOracle {

        @Override
        public void requestSuggestions(final Request request,
                        final Callback callback) {
                String query = request.getQuery().toLowerCase();
                Service.query(
                                "query something",
                                new ServiceCallback<String[][]>() {
                                        @Override
                                        public void onSuccess(String[][] 
result) {
                                                Collection<Suggestion> 
suggestions = new ArrayList<Suggestion>
();
                                                for (final String[] row : 
result) {
                                                        suggestions.add(new 
Suggestion() {
                                                                @Override
                                                                public String 
getDisplayString() {
                                                                        return 
row[0] + " - " + row[1];
                                                                }

                                                                @Override
                                                                public String 
getReplacementString() {
                                                                        return 
row[0];
                                                                }
                                                        });
                                                }
                                                Response resp = new 
Response(suggestions);
                                                
callback.onSuggestionsReady(request, resp);
                                        }
                                });
        }
}


On Oct 4, 12:26 pm, John Restrepo <[email protected]>
wrote:
> Hi, as you noticed I'm just learning GWT, I've been testing
> MultiWordSuggestOracle and SuggestBox, but now I want to try it
> connecting it to a database, I've been looking for documentation but
> due to my limited knowledge I don't understand too much, this post is
> for asking you for some example how to do this if have one, thanks a
> lot.
--~--~---------~--~----~------------~-------~--~----~
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