You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@zkauker
Calling functions in the presenter from the renderer doesn't fit well in the programming model unfortunately.
I'd propose a solution that can bring the necessary data into the viewmodel (presenter):
create a bindActiveTabIndex in TabSheet so that the active tab index is can be reflected in the viewmodel
create a tabClicked(ParametricEventHandler handler) method on TabSheet. Calling this method will cancel the automatic tab-switching behaviour of the tabsheet, and the handler has to explicitly switch tabs using the bound activeTabIndex property.
create an "automaticTabSwitch" boolean property on the model (default true), the tabClicked method will set this to false.
create a clickedTabIndex int property on the model.
in the tabLink.click method in the renderer put an if based on the automaticTabSwitch value. If it's false, we don't immediately set the activeTabIndex, but instead we set the clickedTabIndex.
In the tabClicked method if the clickedTabIndex changes, we fire the given listener.
This seems like a little hack, but we need a quite fast solution for now for the business need I guess. @zkauker if this is okay for you, then @mterjeki please do it this way.
So that the tab switching can be "cancellable".
(This doesn't actually fit well into the programming model)
The text was updated successfully, but these errors were encountered: