.myStackPanel .gwt-StackPanel {
background-color: white;
border: 1px solid #AAAAAA;
width: 15em;
}
.myStackPanel .gwt-StackPanel .gwt-StackPanelItem {
border: 1px solid #AAAAAA;
background-color: #CCCCCC;
cursor: pointer;
cursor: hand;
}
.myStackPanel .gwt-StackPanel .gwt-StackPanelItem-selected {
background-color: #999999;
}
This didn't work. I am definitely not a CSS expert. If anyone can help
me figure this out, I would really appreciate it. Thanks in advance!!
Amy
Then you just need to use that name in the CSS definitions e.g.:
> .myStackPanel {
> background-color: white;
> border: 1px solid #AAAAAA;
> width: 15em;
>
> }
>
> .myStackPanel .gwt-StackPanelItem {
> border: 1px solid #AAAAAA;
> background-color: #CCCCCC;
> cursor: pointer;
> cursor: hand;
>
> }
>
> .myStackPanel .gwt-StackPanelItem-selected {
> background-color: #999999;
>
> }
Hope that helps!
//Adam
Just to add another wrinkle, the second StackPanel is actually nested
inside an element of the first StackPanel. If the nested StackPanel is
the selected element, and I click on one of its elements, I get some
weird behavior. If I click on the second element in the nested
StackPanel, the outer StackPanel actually opens up to its second
element. Is this due to event bubbling or something? Is there a simple
way to fix this problem?
Thanks again for any help!
So now my only problem is the weird behavior on the click. Any
thoughts here would be appreciated. Thanks a lot for the CSS hints!!
Glad you managed to get the styling working. As for the strange
behaviour on clicking, that seems to be a known bug:
http://code.google.com/p/google-web-toolkit/issues/detail?id=834
which looks like it is slated to be fixed in Release 1.4.
If you can't wait till then and you're comfortable with GWT I guess
you could always try fixing the panel issue yourself by subclassing
the StackPanel and preventing the event bubbling. I've not tried the
following code, but it might be one approach:
class MyStackPanel extends StackPanel{
public void onBrowserEvent(Event event){
super.onBrowserEvent(event);
DOM.eventCancelBubble(event,true);
}
}
Hope that helps in some way!
//Adam
Co-author of GWT In Action http://www.manning.com/hanson
GWT Example http://dashboard.manning-sandbox.com
Thanks again for your help!
Amy