Doubt about Event

I Create one class(with Desginer) named crudUser that class extends VerticalLayout, so then I put that class in one tabsheet, It`s possible to in my crudUser class, listen when my tabsheet changes? (and cancel or not the changes)

tks

You need to implement TabSheet#SelectedTabSheetListener. See also https://vaadin.com/docs/-/part/framework/layout/layout-tabsheet.html#layout.tabsheet.events

Don`t work

public class NovaFichaImpl extends NovaFicha implements TabSheet.SelectedTabChangeListener{ I implement the method

@Override public void selectedTabChange(TabSheet.SelectedTabChangeEvent selectedTabChangeEvent) {
  System.out.println("change");
}

Hi,

did you also do something like follows:

tabsheet.addSelectedTabChangeListener(this);
// assuming it's run in the NovaFichaImpl class, possibly in the constructor

But my problem is that all in separated files, my tabsheet are one class(PrincipalImpl, tha have one tabsheet and header), and my NovaFichaImpl(panel) is another, and if I put the event in tabsheet when I create one panel to add in tabsheet I will need to add in my addSelectedTabChangeListener the code from this new class.

I want to in my new Panel (in this sample NovaFichaImpl) listen any tabsheet event fired by he parent component

Hi,

so if I your Panel component implements TabSheet.SelectedTabChangeListener and you create a panel for each page of the TabSheet, could you add call tabsheet.addSelectedTabChangeListener(panel) in your class with the tabsheet once you have created the panel(s).

-Olli