While working with some of the new Layout widgets (DockLayoutPanel in
particular), I noticed
that older widgets, such as HTML, automatically set a default primary
style name in the
constructor, while the DockLayoutPanel does not.
This isn't terrible in and of itself, but in my UiBinder template, I
have the following code:
<g:DockLayoutPanel styleName="{style.main}"
addStyleNames="{global.style.html}" unit="PX">
...
</g:DockLayoutPanel>
When UiBinder generates the code for this element, the order of
attribute processing is not
preserved, and the resulting code is as follows:
f_DockLayoutPanel1.addStyleName("" + global.style().html() + "");
f_DockLayoutPanel1.setStyleName("" + style.main() + "");
Because "setStyleName()" is called second, the previously added style
names are blown away.
Additionally, for whatever reason, changing the "styleName" attribute
on my DockLayoutPanel to
"stylePrimaryName" yields exactly the same results. Yet on a <g:HTML /
> element, the
combination of "stylePrimaryName" and "addStyleNames" works as
expected.
~~~~~~~~~~~~~~~~
I posted this as an issue over at the GWT project site:
http://code.google.com/p/google-web-toolkit/issues/detail?id=4435
The ticket includes a GWT project attachment with a failing unit test.
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors