I have created a text Field and i have associated a change handler
with it. What i want is when user enters some text it should call the
ChangeHandler.onChange(ChangeEvent event) method but it is not
working.

public void onModuleLoad() {

                final TextBox searchField = new TextBox();
                searchField.setText("");
                Button searchButton = new Button();
                searchButton.setText("Search");

                searchButton.addClickHandler(new ClickHandler() {
                        public void onClick( ClickEvent event) {
                                searchContact(searchField);
                        }
                });
                searchField.addChangeHandler(new ChangeHandler() {
                        public void onChange(ChangeEvent event) {
                                searchContact(searchField);
                        }
                });


                RootPanel.get("search-field").add(searchField);
                RootPanel.get("search-button").add(searchButton);
                // We can add style names to widgets




        }

        public void searchContact(TextBox searchField) {
                Window.alert(searchField.getText());
        }

whenever i change the value of the field the event should be fired.
Kindly tell me how i can do that.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to