write a Composite with static or dynamic built elements inside, they just use it as it was a widget
On 11 Aug., 03:07, "A/C A/C" <acro...@gmail.com> wrote: > Is there a way to write some html directly. Add this html to an > existing gwt widget as a child and then wrap the html elements so they > become gwt objects? > > That is: > I want to write something like > > String myHtml=" > <div id='outerDiv'><h1>Hello text field</h1><input type='text' > id='myTextField'></div>"; > > I then want to create a widget with this html, so I do a > new HTML(myString) and add this html widget to my panel. So far so > good, but then I want to wrap myTextField so it become a gwt object, > but if I do a > TextBox.wrap(DOM.getElementById("myTextField"); > I get an > > java.lang.AssertionError: A widget that has an existing parent widget > may not be added to the detach list at > com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java: > 136) > > If i understand this correct, I can't wrap an html element if the html > element it is in html that have a parent which is a gwt widget. > > So is there anyway to do what I have tried to describe above? I don't > have to make the html at runtime, so I thought about placing the html > in a display: none block in the page which contain my gwt root panel, > and then use DOM methods to move it to where I wan't it at runtime, > but this still give me the exception above when I try to wrap the html > elements . > > Martin -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.