Search code examples
javagwtsencha-architect

How to addSelectHandler to TabitemConfig Gxt3?


I'am working in GXT3 project and i need to add a SelectEvent to TabItemConfig in TabPanel. For example, we can't go to another tabItem if the form in current tabItem doesnt't validate.


Solution

  • Why can't you use

            TabPanel panel;
            panel.addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() {
    
                @Override
                public void onBeforeSelection(BeforeSelectionEvent<Widget> event) {
                    //some condition
                    event.cancel();
                }
            });
    

    you can get event.getItem() and do validation of current tabItem