Unfortunately, HTMLPanel always calls setElement() in its constructor.
Is there any way around this other than extending ComplexPanel and
copying the parts of HTMLPanel which I want?
On 27 mai, 01:46, Tom Davies <tgdav...@gmail.com> wrote:
> I'd like to use an HTMLPanel widget with its HTML provided by a
> UiBinder template.
>
> Unfortunately, HTMLPanel always calls setElement() in its constructor.
Just like any widget.
> Is there any way around this other than extending ComplexPanel and
> copying the parts of HTMLPanel which I want?
I really don't understand how you'd like to use HTMLPanel and what
prevents you just using it.
Just so you know, because it isn't documented, you can choose the tag
name of the root element with UiBinder (the HTMLPanel(String,String)
constructor), just use a tag="" attribute, e.g.
<g:HTMLPanel>This will use a div element</g:HTMLPanel>
<g:HTMLPanel tag='p'>While this will use a p element</g:HTMLPanel>
You can then use an HTMLPanel as the root of your UiBinder and build
your widget as a Composite, passing the HTMLPanel built by UiBinder to
the initWidget method.