How to access SuggestionMenu.getNumItems() from outside of a SuggestBox context?

34 views
Skip to first unread message

membersound

unread,
Mar 9, 2013, 12:24:57 PM3/9/13
to google-we...@googlegroups.com
HI,

I have a SuggestBox, and want to know how many items are currently displayed.
There is a private int SuggestionMenu.getNumItems() which would return this number. How can I access this or similar method to return the suggestions list size?

Juan Pablo Gardella

unread,
Mar 9, 2013, 12:29:50 PM3/9/13
to google-we...@googlegroups.com
Copy this class in your project and modify this method and make it public.


2013/3/9 membersound <kodyr...@gmail.com>
HI,

I have a SuggestBox, and want to know how many items are currently displayed.
There is a private int SuggestionMenu.getNumItems() which would return this number. How can I access this or similar method to return the suggestions list size?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Kody

unread,
Mar 9, 2013, 12:34:23 PM3/9/13
to google-we...@googlegroups.com
SuggestBox has so many dependencies, also some protected which means I would have to copy a whole bunch of original gwt classes in my project. That's no option...


2013/3/9 Juan Pablo Gardella <gardella...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/EFYPPXQn3OY/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Thomas Broyer

unread,
Mar 9, 2013, 12:35:43 PM3/9/13
to google-we...@googlegroups.com
SuggestionDisplay's showSuggestions is passed the Collection of suggestions, you can thus easily extend DefaultSuggestionDisplay  and store the collection's size in a field to retrieve it later. 

membersound

unread,
Mar 9, 2013, 1:11:06 PM3/9/13
to google-we...@googlegroups.com
Thanks Thomas, I already have an extended SuggestionDisplay, so I implemented your hint and it now works as expected!
Reply all
Reply to author
Forward
0 new messages