0

open new windows from listBox

asked 2012-12-12 09:49:49 +0800

kazma gravatar image kazma
15 3

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>

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-12-12 14:54:56 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2012-12-12 14:56:02 +0800

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(); ????

link publish delete flag offensive edit

answered 2012-12-13 07:29:15 +0800

kazma gravatar image kazma
15 3

thanks , i solved it !! there was no window tags in the page that i wanted to open!

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

Follow

RSS

Stats

Asked: 2012-12-12 09:49:49 +0800

Seen: 66 times

Last updated: Dec 13 '12

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