-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi i have a listbox and i want to open a new window when clicking on a cell in the list this is my code :
its giving me an error :
Cannot cast org.zkoss.zul.Grid to org.zkoss.zul.Window
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window border="none" apply="org.zkoss.bind.BindComposer"
width="100%" height="100%"
viewModel="@id('vm') @init('finance.invoicing.InvoicingViewModel')">
<grid>
<columns>
<column width="150px" label="Billing Cycle"
align="center" />
<column width="150px" label="End Date" align="center" />
<column width="150px" label="Invoicing Date"
align="center" />
<column width="150px" align="center" />
</columns>
<rows>
<row width="150px">
<hbox align="center" height="30px">
<listbox id="lstBillCycle"
selectedItem="@bind(vm.selectedBCycle)"
model="@load(vm.billingCycle)" mold="select" vflex="true"
hflex="1">
<template name="model" var="item">
<listitem>
<listcell
label="@load(item.billingCycle)">
</listcell>
</listitem>
</template>
</listbox>
</hbox>
<datebox id="datefrom" mold="rounded"
value="@bind(vm.toDate)" format="yyyy-MM-dd" />
<datebox id="dateto" mold="rounded"
value="@bind(vm.invoicingDate)" format="yyyy-MM-dd" />
<button id="submit" label="Submit"
onClick="@command('search')">
</button>
</row>
<row spans="8">
<listbox visible="true" id="lstgenerate"
height="500px" model="@bind(vm.lstGenerate)"
style="margin-top:10px">
<listhead>
<listheader id="cust" label="Customer Name" />
<listheader id="country"
label="Unrated Mins" />
<listheader id="destination"
label="Invoice" />
<listheader id="date" label="From Date" />
<listheader id="fx" label="To Date" />
<listheader id="calls" label="Amount Outsd" />
<listheader id="minutes"
label="Invoice Amount" />
<listheader id="sales" label="Total Amount" />
</listhead>
<template name="model" var="invoicing">
<listitem>
<listcell
label="@bind(invoicing.costumerName)"
onClick="@command('gotoUpdate', invoicing=invoicing)">
<attribute name="onClick">
Grid guestWnd = (Grid)Executions.createComponents("updateCostumer.zul", null, null);
guestWnd.detach();
</attribute>
</listcell>
<listcell
label="@bind(invoicing.unratedMins)">
</listcell>
<listcell
label="@bind(invoicing.invoice)">
</listcell>
<listcell
label="@bind(invoicing.lstFromDate)">
</listcell>
<listcell
label="@bind(invoicing.lstToDate)">
</listcell>
<listcell
label="@bind(invoicing.amountOustand)">
</listcell>
<listcell
label="@bind(invoicing.invoiceAmt)">
</listcell>
<listcell
label="@bind(invoicing.totalAmt)">
</listcell>
</listitem>
</template>
</listbox>
</row>
</rows>
</grid>
<zscript>
</zscript>
</window>
</zk>
seems your 'updateCostumer.zul' have as outer main component a window
so change the line to
Window guestWnd = (Window)Executions.createComponents("updateCostumer.zul", null, null);
guestWnd.detach(); ????
Asked: 2012-12-12 09:49:49 +0800
Seen: 66 times
Last updated: Dec 13 '12
ZK studio and eclipse outline problem
ZK Package configuration problem
Eclipse Autocomplete not working in ZUL files...
Syntax Error mark ... help me!
Manual Installation of ZK Studio
Can't see button text whilst running simple demo
Adding Vbox to Center layout in Java