GWT Menu Active Item Hightlighted

544 views
Skip to first unread message

karmela

unread,
Sep 30, 2008, 11:45:23 AM9/30/08
to Google Web Toolkit
Hi all,
Hope someone can help me with this.
I want to have the active menu item to be highlighted. Basically when
an item gets selected and goes to a page, i want that link (menu item)
to be in a different color.
Is that possible to do with GWT?

Thanks!

Sumit Chandel

unread,
Oct 2, 2008, 9:54:02 AM10/2/08
to Google-We...@googlegroups.com
Hi Karmela,

Have you taken a look at the latest Menu Bar widget in the Showcase sample application? It provides default CSS styles for menu items to be highlighted whenever the cursor is hovering over them.

You can check it out here:


Note that you can see both the Java source and the CSS code for the Menu Bar in the same display. You should be able to use this and tweak the styles for the purpose of your application.

Hope that helps,
-Sumit Chandel

karmela

unread,
Oct 3, 2008, 8:18:22 AM10/3/08
to Google Web Toolkit
Hi Sumit,
Thank you so much for getting back to me.
The hovering works just fine. When hover over the menu item the class
changes to gwt-MenuItem-selected. But when an actual item is selected,
the class/id does not change.
So I'm not sure how to change the class so that I can give it specific
style.
I'd really appreciate it if you could help.

Thanks again Sumit.
Karmela


On Oct 2, 9:54 am, "Sumit Chandel" <sumitchan...@google.com> wrote:
> Hi Karmela,
> Have you taken a look at the latest Menu Bar widget in the Showcase sample
> application? It provides default CSS styles for menu items to be highlighted
> whenever the cursor is hovering over them.
>
> You can check it out here:
>
> http://gwt.google.com/samples/Showcase/Showcase.html#CwMenuBar
>
> Note that you can see both the Java source and the CSS code for the Menu Bar
> in the same display. You should be able to use this and tweak the styles for
> the purpose of your application.
>
> Hope that helps,
> -Sumit Chandel
>

karmela

unread,
Oct 7, 2008, 10:18:55 AM10/7/08
to Google Web Toolkit
Still having the same problem.
I need to make the selected link from the menu to be in a different
color. When the user goes to a specific page, that page on the menu is
in a different color.
How can I add a class/id to the menu items?

In MenuItem class there is private static final String
DEPENDENT_STYLENAME_SELECTED_ITEM = "selected"; which is a style for
the item that is hovered over. I need to make the same thing for an
active MenuItem.

Any help would be greatly appreciate it.


Thanks,
Karmela

karmela

unread,
Oct 16, 2008, 3:36:29 PM10/16/08
to Google Web Toolkit
Can anyone help with this?
If I can add an id to the menu item that is active (clicked on), then
I can change the style with css.

Thanks in advance.

Karmela
Reply all
Reply to author
Forward
0 new messages