Domanda

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.

È stato utile?

Soluzione

Try this:

topMenu.addItemListener(...) //instead of addListener
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top