Hi thanks for your response but i don't get it :-( Can you make an example with pseudo code? Thanks
On 27 Sep., 02:09, Dominik Steiner <dominik.j.stei...@googlemail.com> wrote: > Hi ojay, > > did you try to make your KeyListener an anonymous class so that you > can reference from within it the formList and then change the > selection of the ListBox by using the method > > formList.setSelectedIndex(int index); > > HTH > > Dominik > > On 25 Sep., 17:07, ojay <oliver.ja...@googlemail.com> wrote: > > > Hi, > > > after I read the intro to gwt in practice and looking around on the > > gwt site I just started my first steps with gwt and now I'm stuck. > > > I guess its an easy question for you guys... > > > I have a textbox and a listbox in my project. Now I added a > > KeyPressHandler to the textbox so that I can do something if somebody > > types in. I want to use this textbox input as a filter for the shown > > values in the listbox. So now what I do not know is, how can I > > initialize a change of the Listbox from my KeyPressHandler ?? > > > Here my Module > > > public void onModuleLoad() { > > // Create a tab panel with three tabs, each of which > > displays a > > different > > // piece of text. > > KeyPressHandler changeFormFilter = new FormFilterChanger(); > > > VerticalPanel formSelectPanel = new VerticalPanel(); > > formSelectPanel.setSize("150px", "400px"); > > > TextBox formFilterBox = new TextBox(); > > formFilterBox.setFocus(true); > > formFilterBox.setSize("150px", "20px"); > > > formFilterBox.addKeyPressHandler(changeFormFilter); > > formFilterBox.addChangeHandler(handler) > > > ListBox formList = new ListBox(false); > > formList.setVisibleItemCount(10); > > > for ( int i = 0; i < 40; i++){ > > formList.addItem("form"+i); > > } > > formList.setSize("150px", "380px"); > > > formSelectPanel.add(formFilterBox); > > formSelectPanel.add(formList); > > > RootPanel.get().add(formSelectPanel); > > > } > > > and the Handler > > > public class FormFilterChanger implements KeyPressHandler { > > > @Override > > public void onKeyPress(KeyPressEvent event) { > > System.out.println("change"); // TODO > > Auto-generated method stub > > > } > > > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---