Tuesday, October 25, 2011

Re: can we control what element will build in widget?

http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/dom/client/Element.html

Look at "direct known sub classes". There is one element type for each html tag. 

If you create a custom widget (class MyWidget extends Widget) you have to call setElement(Element e) in MyWidget's constructor. This will tell the Widget which HTML element to use as its container. A GWT Label for example calls setElement(DOM.createDiv()) whereas an InlineLabel does setElement(DOM.createSpan()).


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/aiT3E8KwNmgJ.
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.

No comments:

Post a Comment