Difference between revisions of "Msz"
From Documentation
Line 10: | Line 10: | ||
= Prerequisites = | = Prerequisites = | ||
− | = The | + | = The MainController.java = |
<source lang="java" > | <source lang="java" > | ||
+ | public class MainController extends SelectorComposer<Window>{ | ||
+ | /** | ||
+ | * | ||
+ | */ | ||
+ | private static final long serialVersionUID = 1L; | ||
+ | |||
+ | @Wire("#treeReports") private Tree treeReports; | ||
+ | @Wire("#mainTabs") private Tabbox mainTabs; | ||
+ | @Wire("#mainTabs > tabs") private Tabs tabs; | ||
+ | @Wire("#mainTabs > tabpanels") private Tabpanels tabpanels; | ||
+ | |||
+ | private void setTabValue(String url, String nameReport) { | ||
+ | Tab tab = new Tab(nameReport); | ||
+ | tab.setClosable(true); | ||
+ | tab.setSelected(true); | ||
+ | tabs.appendChild(tab); | ||
+ | |||
+ | Tabpanel tabpanel = new Tabpanel(); | ||
+ | Include include = new Include(url); | ||
+ | tabpanel.appendChild(include); | ||
+ | tabpanels.appendChild(tabpanel); | ||
+ | } | ||
+ | |||
+ | @Listen("onClick = #viewReport") | ||
+ | public void showReport() { | ||
+ | if (treeReports.getSelectedItem() != null) { | ||
+ | String url = treeReports.getSelectedItem().getValue(); | ||
+ | String label = treeReports.getSelectedItem().getLabel(); | ||
+ | setTabValue(url, label); | ||
+ | } else { | ||
+ | showNotify("Select the report"); | ||
+ | return; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | private void showNotify(String msg) { | ||
+ | Clients.showNotification(msg,"warning",null,null,0); | ||
+ | } | ||
+ | } | ||
</source> | </source> |
Revision as of 09:05, 5 June 2014
Integrating_BIRT_Viewer_Toolkit_and_ZK
Author
Shamil' Mustafin, Engineer, Nefteavtomatika, Russia
Shamil' Mustafin, Engineer, Nefteavtomatika, Russia
Date
June 03, 2014
June 03, 2014
Version
ZK CE 7.0.2
ZK CE 7.0.2
Introduction
Prerequisites
The MainController.java
public class MainController extends SelectorComposer<Window>{
/**
*
*/
private static final long serialVersionUID = 1L;
@Wire("#treeReports") private Tree treeReports;
@Wire("#mainTabs") private Tabbox mainTabs;
@Wire("#mainTabs > tabs") private Tabs tabs;
@Wire("#mainTabs > tabpanels") private Tabpanels tabpanels;
private void setTabValue(String url, String nameReport) {
Tab tab = new Tab(nameReport);
tab.setClosable(true);
tab.setSelected(true);
tabs.appendChild(tab);
Tabpanel tabpanel = new Tabpanel();
Include include = new Include(url);
tabpanel.appendChild(include);
tabpanels.appendChild(tabpanel);
}
@Listen("onClick = #viewReport")
public void showReport() {
if (treeReports.getSelectedItem() != null) {
String url = treeReports.getSelectedItem().getValue();
String label = treeReports.getSelectedItem().getLabel();
setTabValue(url, label);
} else {
showNotify("Select the report");
return;
}
}
private void showNotify(String msg) {
Clients.showNotification(msg,"warning",null,null,0);
}
}