TabLayoutPanel looses its CSS style when placed in a CSS- grid container

550 views
Skip to first unread message

Martin Weber

unread,
Jul 11, 2019, 2:47:32 PM7/11/19
to GWT Users
Hi,
 I'am faced with a weird issue.
When I place a TabLayoutPanel in a CSS grid container, the header tabs are displayed as plain text.
No margins, coloring etc.
In the browser's HTML inspector, I see that the tab header elements have the class attributes set tho the GWT-styles for TabLayoutPanel. But somehow the GWT stylesheet/ styles are missing.
What am I doing wrong?
Any suggestion to make it work?

In contrast,  a DataGrid placed in the same CSS-grid container looks fine.

TIA, Martin

Craig Mitchell

unread,
Jul 15, 2019, 4:00:03 PM7/15/19
to GWT Users
Odd that it would lose the CSS.  You could try putting in the CSS yourself.  You can copy it from here  http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTabLayoutPanel  or from the standard.css file in your project.

Martin Weber

unread,
Aug 5, 2019, 3:54:13 PM8/5/19
to google-we...@googlegroups.com
Am Montag, 15. Juli 2019, 22:00:03 CEST schrieb Craig Mitchell:
> Odd that it would lose the CSS. You could try putting in the CSS
> yourself. You can copy it from here
> http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTabLayoutPan
> el or from the standard.css file in your project.

This did not help.
But maybe I found the real issue:
To place the TabLayoutPanel in a CSS grid container, I added a
styleName="{style.c1}" attribute to the TabLayoutPanel in the ui.xml.
Setting a styleName seems to replace the existing CSS styles completely (for a
DataGrid, this is not the case).
As a workaround, I had to wrap g:TabLayoutPanel in a <div class="{style.c1}">.


>
> On Thursday, 11 July 2019 20:47:32 UTC+2, Martin Weber wrote:
> > Hi,
> >
> > I'am faced with a weird issue.
> >
> > When I place a TabLayoutPanel in a CSS grid container, the header tabs are
> > displayed as plain text.
> > No margins, coloring etc.
> > In the browser's HTML inspector, I see that the tab header elements have
> > the class attributes set tho the GWT-styles for TabLayoutPanel. But
> > somehow
> > the GWT stylesheet/ styles are missing.
> > What am I doing wrong?
> > Any suggestion to make it work?
> >
> > In contrast, a DataGrid placed in the same CSS-grid container looks fine.
> >
> > TIA, Martin


--
There are only two hard problems in Computer Science: cache invalidation,
naming things, and off-by-one errors.




Craig Mitchell

unread,
Aug 25, 2019, 8:58:23 PM8/25/19
to GWT Users
Ah, yes.  You want to call addStyleName, not setStyleName.  I think you call addStyleNames via the UIBinder.
Reply all
Reply to author
Forward
0 new messages