質問

I got the class TopMenu which extends MenuBar vaadin component and I override method: addItem - this method is use to add items - now I got other class where I create

TopMenu topMenu = TopMenu();

and add as a component

addComponent(topMenu)

I need add listener to topMenu like:

topMenu.addListener(ClickListener...){...}

and get the item to change his styleName/layout

I can't use item command, thanks for help.

役に立ちましたか?

解決

Try this:

topMenu.addItemListener(...) //instead of addListener
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top