ListBox - several Questions

82 views
Skip to first unread message

feuse8

unread,
Nov 28, 2012, 7:15:23 AM11/28/12
to google-we...@googlegroups.com
Hi,

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.

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). Any ideas for this? (would be similar to this: http://www.smartclient.com/smartgwt/showcase/#local_db_combobox_combobox_category)

Thanks for your help!

Regards!

Thomas Broyer

unread,
Nov 28, 2012, 8:41:27 AM11/28/12
to google-we...@googlegroups.com


On Wednesday, November 28, 2012 1:15:23 PM UTC+1, feuse8 wrote:
Hi,

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.
You might be interested in GWT Chosen http://jdramaix.github.com/gwtchosen/ 
Reply all
Reply to author
Forward
0 new messages