Revision history [back]

click to hide/show revision 1
initial version

answered 2014-09-23 13:11:13 +0800

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

ZUL :

<zk xmlns:h="native">
    <window id="win" border="none" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('org.novelerp.controller.DashboardUIController')" xmlns:d="http://www.zkoss.org/2005/zk/client/attribute">
        <div class="dashboard_links">
            <h:ul>
                <h:li class="gu no-border" if="${sessionScope.isCRCAdmin}">
                    <a id="bplanlink" onClick="@command('bplanlink', selected = bplanpanel)">Billing Plan</a>
                </h:li>
            </h:ul>
        </div>
        <tabbox mold="accordion">
            <tabs selectedPanel="@bind(vm.selectedPanel)">
                <tab sclass="gu" id="tabbplan" style="font-size: 13px;" if="${sessionScope.isCustomer}" visible="@load(vm.tabbplanVisible)">Billing Plan</tab>
            </tabs>
            <tabpanels>
                <tabpanel id="bplanpanel" if="${sessionScope.isCustomer}">
                    <grid model="@bind(vm.billingPlansList2)" >
                        <columns sizable="true">
                            <column label="Billing Date"></column>
                            <column label="Date Description"></column>
                            <column label="MileStone Relavance"></column>
                            <column label="Block"></column>
                            <column label="Billing Status"></column>
                        </columns>
                        <template name="model">
                            <row>
                                <label value="@bind(each.billingdate)"></label>
                                <label value="@bind(each.datedescription)"></label>
                                <label value="@bind(each.milestonerelavance)"></label>
                                <label value="@bind(each.billingblock)"></label>
                                <label value="@bind(each.billingstatus)"></label>
                            </row>
                        </template>
                    </grid>
                </tabpanel>
            </tabpanels>

        </tabbox>
    </window>
</zk>

JAVA

See that class don't extend any class. remove also all the @wire.

public class DashboardUIController {

    private Boolean tabbplanVisible = Boolean.FALSE;
    private Tabpanel selectedPanel;

    public Boolean getTabbplanVisible () {
        return tabbplanVisible;
    }

    public void setTabbplanVisible(Boolean tabbplanVisible) {
        this.tabbplanVisible = tabbplanVisible;
    }

    public Tabpanel getSelectedPanel () {
        return selectedPanel;
    }

    public void setSelectedPanel (Tabpanel selectedPanel) {
        this.selectedPanel = selectedPanel;
    }


    @NotifyChange({"billingPlansList2","selectedPanel","tabbplanVisible"})
    public void billingPlan(@BindingParam("selected") Tabpanel bplanpanel) {
        setSelectedPanel(bplanpanel);
        setTabbplanVisible(Boolean.TRUE);
        billingPlansList2 = new BillingPlanServiceImpl().getBillinPlanList("");

        for (BillingPlan bplan : billingPlansList2) {
            billplan = new BillingPlan();
            System.out.println(":bplan.getBillingdate():-" + bplan.getBillingdate());
            billplan.setBillingdate(bplan.getBillingdate());
        }
    }

}

Try this. Didn't test it(wrote it in notepad++) but it shall be close to what you want.

Greetz chill.

ZUL :

<zk xmlns:h="native">
    <window id="win" border="none" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('org.novelerp.controller.DashboardUIController')" xmlns:d="http://www.zkoss.org/2005/zk/client/attribute">
        <div class="dashboard_links">
            <h:ul>
                <h:li class="gu no-border" if="${sessionScope.isCRCAdmin}">
                    <a id="bplanlink" onClick="@command('bplanlink', selected = bplanpanel)">Billing Plan</a>
                </h:li>
            </h:ul>
        </div>
        <tabbox mold="accordion">
            <tabs mold="accordion" selectedPanel="@bind(vm.selectedPanel)">
            <tabs>
                <tab sclass="gu" id="tabbplan" style="font-size: 13px;" if="${sessionScope.isCustomer}" visible="@load(vm.tabbplanVisible)">Billing Plan</tab>
            </tabs>
            <tabpanels>
                <tabpanel id="bplanpanel" if="${sessionScope.isCustomer}">
                    <grid model="@bind(vm.billingPlansList2)" >
                        <columns sizable="true">
                            <column label="Billing Date"></column>
                            <column label="Date Description"></column>
                            <column label="MileStone Relavance"></column>
                            <column label="Block"></column>
                            <column label="Billing Status"></column>
                        </columns>
                        <template name="model">
                            <row>
                                <label value="@bind(each.billingdate)"></label>
                                <label value="@bind(each.datedescription)"></label>
                                <label value="@bind(each.milestonerelavance)"></label>
                                <label value="@bind(each.billingblock)"></label>
                                <label value="@bind(each.billingstatus)"></label>
                            </row>
                        </template>
                    </grid>
                </tabpanel>
            </tabpanels>

        </tabbox>
    </window>
</zk>

JAVA

See that class don't extend any class. remove also all the @wire.

public class DashboardUIController {

    private Boolean tabbplanVisible = Boolean.FALSE;
    private Tabpanel selectedPanel;

    public Boolean getTabbplanVisible () {
        return tabbplanVisible;
    }

    public void setTabbplanVisible(Boolean tabbplanVisible) {
        this.tabbplanVisible = tabbplanVisible;
    }

    public Tabpanel getSelectedPanel () {
        return selectedPanel;
    }

    public void setSelectedPanel (Tabpanel selectedPanel) {
        this.selectedPanel = selectedPanel;
    }


    @NotifyChange({"billingPlansList2","selectedPanel","tabbplanVisible"})
    public void billingPlan(@BindingParam("selected") Tabpanel bplanpanel) {
        setSelectedPanel(bplanpanel);
        setTabbplanVisible(Boolean.TRUE);
        billingPlansList2 = new BillingPlanServiceImpl().getBillinPlanList("");

        for (BillingPlan bplan : billingPlansList2) {
            billplan = new BillingPlan();
            System.out.println(":bplan.getBillingdate():-" + bplan.getBillingdate());
            billplan.setBillingdate(bplan.getBillingdate());
        }
    }

}

Try this. Didn't test it(wrote it in notepad++) but it shall be close to what you want.

Greetz chill.

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