Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT Suggestbox define suggest oracle after instantiation

I've defined a suggestbox in UIBinder, and I need to dynamically set its SuggestOracle. All the examples I've seen show that you can only define the suggestoracle at instantiation, but I need to define this AFTER the fact. Is there a way to do this?

Thanks!

like image 578
Rob Avatar asked Aug 22 '11 17:08

Rob


1 Answers

Use the method getSuggestOracle at SuggestBox to get the oracle. By default, it's from type MultiWordSuggestOracle. Then, just add the words you want:

MultiWordSuggestOracle orcl = (MultiWordSuggestOracle) suggestBox.getSuggestOracle();
orcl.addAll(words);
like image 119
Italo Borssatto Avatar answered Oct 06 '22 19:10

Italo Borssatto