On Wednesday, November 28, 2012 1:15:23 PM UTC+1, feuse8 wrote:
I would like to "pimp" GWTs ListBox in order to get some additional functionaility. Maybe you can help me with some issues.
1. I would like to dynamically add Items to my ListBox: when the user scrolls using the scrollbar an event should be thrown. I tried attaching a ScrollEvent which doesn't work. The only thing that seems to work is the MouseWheelHandler which is only one part of the solution. I would also like to handle the event when the user scrolls using the scrollbar.
ListBox is a simple HTML <select>, so it won't support more. Have a look at ValuePicker.
2. I would like to add a TextBox filter to the ListBox similar to the SuggestBox. The only difference would be the option to open the items with the dropdown Icon and see all entries in a list (this isn't possible with the SuggestBox).
Yes it is: put a button next to your field and call showSuggestionList
from the ClickHandler. In addition, you can get the PopupPanel from the DefaultSuggestionDisplay and add your button as an "auto hide partner" (so that clicking on it while the popup is open doesn't auto-hide the popup, and you can thus call hideSuggestList from your ClickHandler to toggle the popup visibility). And of course you can implement your own SuggestDisplay based on, say, a ValuePicker.