do vaadin menuitems support display of shortcut keys?

Hi All,

I looked around the forums and vaadin open tickets and could not find an answer so I thought I would try here. Does vaadin support display shortcut keys in the menus? In case I am not clear, just open up your browser menubar, and you can notice the menu items have the associated short cut displayed as right justified. I know google docs does this too.

Does vaadin support this? I know a simple way of achieve this is probably just to create custom text and append the shortcut keys’ text, but of course they will not be right justified and is a manual process.

Thanks!

Hi,

That would be great enhancement for the current MenuBar. Could you write a enhancement ticket for it at dev.vaadin.com.

For a workaround, I’m not totally sure, but I think you might be able to render plain HTML inside the caption of the items, so you could maybe add one additional element before the caption text and float that to right?

menubar.addItem("<span class=\"shortcut-key\">A</span>Menu item caption", null);

// CSS 
.v-menubar-submenu .shortcut-key {
    float: right;
}

Hi Jouni,
I opened a ticket:
http://dev.vaadin.com/ticket/6339

Hopefully I did it right. Its the first time I opened one.

Just tried your suggestion and looks like HTML is not allowed in the caption. HTML shows up as standard text.

Thanks!