Tuesday, December 6, 2011

the parameter of the method addHandler

in class Widget,there is a method addHandler(final H handler,
GwtEvent.Type<H> type).
in a customer defined Widget which has a customer defined event,i call
the method addHandler(final H handler, GwtEvent.Type<H> type),and
transmit parameter like this:
addHandler(handler,new Type<XxxHandler>)
but the customer defined event do not take effect at all at the last.
i modified it like this: addHandler(handler,MyEvent.getType),and in
the MyEvent class:
public Type<XxxHandler> getType() {
if(type==null){
type=new Type<XxxHandler>();
}
return type;
}
now,it have no problem.
why?does it will inject the value for "type" auto automatically ?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate