-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I will want to know can it possible to Get ViewModel class from a Selected Tab. Let Us suppose i have a Index.zul page which contain three tabs TabA,TabB,TabC now i select TabA this TabA contain userInfo.zul now i will want to know how we can get ViewModel of selected Tab in my Java class?
Tab tab1v = (Tab) mainTab.getSelectedTab();
Now Selected Tab is TabA can we get the which ViewModel associated with this Tab?
hi sjoshi,
you can use singleton class then you set the viewmodel after you can get viewmodel anywhere. it's not a good idea but your requirement will be fulfill.
Hey sjoshi,
By applying your viewmodel class to your tab you've applied an attribute to it called viewmodel, try to obtain the tab attributes by doing tab1v.getAttribute("viewModel")
.
I had to do this before but I'm not 100% sure if this was the way, but the solution was something like this.
Cheers
Asked: 2013-02-12 10:18:47 +0800
Seen: 60 times
Last updated: Feb 14 '13
Attach existing ViewModel to new tab
issue creating dynamic tabs via controller #2
issue creating dynamic tabs via controller #1
enhancement needed in scrolling tab in tabbox using javacode
Tabbox with Toolbar: how do I give the Toolbar all available space?
Tabbox and Notifications issue
Great Question
hswain ( 2013-02-12 10:35:05 +0800 )edit