Revision history [back]

click to hide/show revision 1
initial version

answered 2013-10-16 20:13:52 +0800

sjoshi gravatar image sjoshi flag of India

http://zkframeworkhint.bl...

You can use below code to get all component of the page

@Command
 public void doExport(@ContextParam(ContextType.VIEW) Component view) throws IOException {
     logger.debug("Export Button is clicked");
     Listbox auditLogListBox = (Listbox) view.query("Listbox") ;
                       }

There are plenty of other way if you wire the component ID with ViewModel

You can use below code to get all component of the page

@Command
 public void doExport(@ContextParam(ContextType.VIEW) Component view) throws IOException {
     logger.debug("Export Button is clicked");
     Listbox auditLogListBox = (Listbox) view.query("Listbox") ;
                       }

There are plenty of other way if you wire the component ID with ViewModel

EDIT:- Check this How to work with include Mainly this part However, if you are using the defer mode and want to access the component inside of them, you have to assign a unique identifier of the page being included. Here is what you can do.

<include mode="defer" src="/mypage.zul?pageId=first"/>
<include mode="defer" src="/mypage.zul?pageId=second"/>

In additions, in the page being include, i.e., mypage.zul in this example, you have to write

<?page id="${param.pageId}"?>

Then, you could access their component by the use of Path as follows.

 Path.getComponent("//first/textbox/");
Path.getComponent("//second/textbox/");

So you have to use like same In your main Zul wrote this code In main.zul file

<include mode="defer" src="/selectionsPanel.zul?pageId=first"/>

In electionsPanel.zul use below line

<?page id="${param.pageId}"?>

Same thing you have to follow other included zuls And in Java code you can use below code

@Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        Tabbox codebookCategWin = (Tabbox) new Path("//first/codebookPanelLeftTabBox").getComponent();
        Tabbox codebookCategWin1 = (Tabbox) new Path("//second/codebookTabbox").getComponent();
        Window win = (Window) new Path("//third/codebookCategoriesWinOuter").getComponent();
        System.out.println();

    }

Note:-Here Composer class added in codebookCategoriesTreePanel.zul

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