Accessing Component from another ZUL file

asked 2012-01-31 08:32:37 +0800

swapndipj gravatar image swapndipj

Hello Everyone,

I am implementing ZK MVC in my project. I have main.zul file which includes list_view.zul file which consist of Listbox component. I want to access the selected list item from Listbox when i click on detail_View button from main.zul file.

following is the code snippet.

<?page title="Home"?>
<window width="100%" height="100%" id="Main" apply="org.MetricCatalogue.Controllers.MainController">
<borderlayout height="100%" width="100%">
<north size="9%">
<include src="Top.zul"/>
<west size="85%">
<toolbar id="tb1" sclass="vista" width="1150px" height="27px" align="start">
<toolbarbutton id="List_View" image="images/List_View.png" tooltiptext="List View" />
<toolbarbutton id="Tree_View" image="images/Tree_View.png" tooltiptext="Tree View" />

<window id="View">
<include src="List_View.zul"/>
<east size="15%">
<vbox style="padding:10px;">
<button id="Detail_Search" image="images/detailes.png" label="Detail View" width="180px" height="35px"/>
<listheader label="Metric Catalogue Wall" />



<?page id="listPage"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
import org.MetricCatalogue.Model.MetricMaster;
import org.MetricCatalogue.DAO.MetadataExtractor;
List persons = new ArrayList();
MetadataExtractor me=new MetadataExtractor();
<listbox model="@{persons}" apply="org.MetricCatalogue.Controllers.MainController" id="Metric_List" width="99%" style="padding:2px" mold="paging" pageSize="7">
<listheader label="Metric ID" width="10%"/>
<listitem self="@{each=MetricMaster}" value="@{MetricMaster}">
<listcell label="@{MetricMaster.MetricID}"/>

public void onClick$Detail_Search(Event e)
How can I access the selected List item from List_View.ZUL Metric_List.


delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-02-03 03:45:05 +0800

swapndipj gravatar image swapndipj

Hello techies,

Has anyone get the solutions for this issue?


link publish delete flag offensive edit

answered 2012-02-06 02:17:05 +0800

matthewgo gravatar image matthewgo

Hi Swapnil,
Please try the following code:


link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2012-01-31 08:32:37 +0800

Seen: 138 times

Last updated: Feb 06 '12

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