Re: Sample of a suggestion box connected to a database

2009-10-05 Thread bchoi

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() {
@Override
public void onSuccess(String[][] 
result) {
Collection 
suggestions = new ArrayList
();
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 
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 google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Sample of a suggestion box connected to a database

2009-10-03 Thread John Restrepo

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 google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---