Friday, February 1, 2013

How to implement HasValue for ListBox?

I have a custom class which is used to assign single handler to all of my UI text fields. 

Custom Class Watcher:
=================

private ValueChangeHandler<String> reusableChangeHandler;

public void registerHandlers(HasValue<String> element) {

        element.addValueChangeHandler(reusableChangeHandler);

    }

The idea here is I can assign all of my textfields same valueChangeHandler.

myView Class:

===========

TestBox myTextBox = new TextBox();

Watcher.registerHandlers(myTextBox);

But it doesn't work for ListBox. How do I make a overloaded method to accomodate Listbox?

Basically I want to do something when any of my UI elements value changes in a center location. 




 



--
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-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@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.
 
 

No comments:

Post a Comment