Revision history [back]

click to hide/show revision 1
initial version

asked 2012-08-24 11:02:29 +0800

sjoshi gravatar image sjoshi flag of India

Issue Implemeting Interesting Macro Component ?

Hi Please help me to resolve this issue.

The Scenario is something like this:- 1- I have created a Macro Component Containing Two ListBox(Left and Right) with a button->mymacrocomponent.zul- ---Done

        style="padding-left: 40px;padding-top:20px;padding-bottom:20px;"
        hflex="1" vflex="1">
        <separator ></separator>

        <listbox id="leftListbox" height="250px" width="250px"
            onDrop="move(event.dragged)" droppable="true" oddRowSclass="non-odd"
                <listheader label="Default Columns" ></listheader>
            <template name="model" var="each">
                <listitem draggable="true" droppable="true"
                    <listcell label="${each}" ></listcell>

        <separator orient="vertical" spacing="20px" ></separator>

        <listbox id="rightListbox" height="250px" width="250px"
            onDrop="move(event.dragged)" droppable="true"
                <listheader label="Selected Columns" ></listheader>


    <button onClick="@command('updatelist')" type="button" label="Save"  id="myButton"></button>

    void move(Component dragged) {
        if (self instanceof Listitem) {
            self.parent.insertBefore(dragged, self);
        } else {

2-I Added this macro Component to another zul file[my_listBox.zul] :-Done

<?component name="refreshListbox" macroURI="/my_macro_component.zul" inline="true"?>

    <window apply="org.zkoss.bind.BindComposer"
        viewModel="@id('vm') @init('org.test.TestVM')" width="100%"

        <button onClick="@command('showModelPopUp')" label="ShowMacro"></button>

        <listbox model="@load(vm.model)" emptyMessage="Empty List"

            <listhead children="@load(vm.headerList)">
                <template name="children" var="headerName">
                    <listheader label="@load(headerName)"></listheader>

        <window title="MacroComponent" id="queryWindow" height="80%"
            width="54%" mode="modal" position="center" closable="true"
            visible="@load(vm.showModelWindow)" popup="true">

            <refreshListbox model="@load(vm.headerList)" height="100%"


3-When User will click on this button* ShowMacro* I opened a Model Window and Shoe Two ListBox in which one list box have data which is coming from ModelViewClass.:-Done

Now Issue is that 4-I want When User will click on the Save button of Macro Component , then ListBox of [my_listBox.zul] file will refresh and data populate again I do not understand How can I achieve this.

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