2013-02-21 151 views
0

我有我在哪裏使用大量的項目,現在,當我點擊我創建一個tab.Something這樣的代碼的任何項目如何從ZK中的SelectedTab獲取ViewModel?

public static void openNewTab(String title, String path, Tabbox mainTab) { 
    Tab tab = new Tab(title); 
    tab.setClosable(true); 
    tab.setParent(mainTab.getTabs()); 
    Tabpanel tabpanel = new Tabpanel(); 
    Include include = new Include(path); 
    include.setParent(tabpanel); 
    tabpanel.setParent(mainTab.getTabpanels()); 
    mainTab.setSelectedTab(tab); 
} 

現在我想選擇的選項卡當的視圖模型工具欄在ZUL任何CTRL鍵按下... 我有這個

@Wire("#mainTab") 
Tabbox mainTab; 
    Tab tab = mainTab.getSelectedTab(); 

能有可能得到來自selectedTab視圖模型varaibles?

,我做這樣的

Include include = new Include(path); 
include.setParent(tabpanel); 
Object object = include.getAttribute("viewModel"); 

現在目標是讓空我們能否從這裏,而我包括ZUL在這裏得到視圖模型?

回答

相關問題