On Monday, February 21, 2011 10:23:13 PM UTC+1, Anm wrote: > > > Is there any inherent, underlying reason why GWT components can't take in > existing DOM references to build their components? >
Most widgets assume their root element's children are entirely manage by them. In the case of a FlowPanel for instance, all children of the root <div> element are "root elements" of the FlowPanel's child Widget-s. For those widgets that have no children, you can use existing elements using a static wrap() method (Button.wrap(), HTML.wrap(), etc.) If not, can someone help me with a quick example of a Composite that might > use existing DOM elements? > > If so, what is the recommended alternative to placing multiple GWT UI > compionents into a existing DOM tree, possibly deeply structured with > components at varied levels (i.e., not just sibling nodes)? > GWT 2.3 will add a wrap() static method to HTMLPanel, so you will be able to HTMLPanel.wrap() an existing element. You won't be able to wrap() any child element of the HTMLPanel's "root element" though, but you can workaround it by taking the element out of the HTMLPanel DOM hierarchy, wrap()ping it and then adding it back to the HTMLPanel (using the HTMLPanel API). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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/google-web-toolkit?hl=en.
