How to Get ViewModel From a Tab class? [closed]

asked 2013-02-12 10:18:47 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

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?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by sjoshi
close date 2013-02-14 17:44:43



Great Question

hswain ( 2013-02-12 10:35:05 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-02-14 17:27:38 +0800

hswain gravatar image hswain flag of India
1763 3 10

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.

link publish delete flag offensive edit

answered 2013-02-13 00:48:17 +0800

spitghost gravatar image spitghost

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.


link publish delete flag offensive edit

Question tools




Asked: 2013-02-12 10:18:47 +0800

Seen: 60 times

Last updated: Feb 14 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More