-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello Everyone!
i've beeing playing with zk a while and now comes serious things.
I've successfull integrated spring and zk and the routing
works as i use
@controller
import org.springframework.ui.Model; //..... @RequestMapping("/accounts/personal/list") public String list(Model model){ try { ArrayOfAccount result = port.getAccounts( null, 0, 20); //i thought with this i can grab the result collection. model.addAttribute(result); } catch (Exception ex) { // TODO handle custom exceptions here } return "accountslist"; }
the real problem is to get the object in the result object in the zul file.
<?xml version="1.0" encoding="UTF-8"?> <?init class="org.zkoss.zk.ui.util.Composition" arg0="/templates/mainlayout.zul"?> <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <zk xmlns="http://www.zkoss.org/2005/zul" xmlns:n="http://www.zkoss.org/2005/zk/native"> <window self="@{define(content)}"> <div> <listbox model="${result}" id="lstAccount" multiple="true"> <listhead> <listheader label="Account Name" /> <listheader label="Account Type" /> <listheader label="Mobile Phone" /> </listhead> <listitem self="@{each='account'}" value="@{account}" > <listcell label="@{account.getAccountName()}" /> <listcell label="@{account.getAccountType()}" /> <listcell label="@{account.getMobilePhone()}" /> </listitem> </listbox> </div> </window> </zk>
it's not throwing an error but i feel like i'm not doing something right.And i also know that i can use GenrericForwardComposer to achieve the
same wihtout hassle.this confuses me about whether i'm doing the right thing.
question 1 :
How can i achive what i was trying to do ?
question 2:
What's the best way using ZKspring(no webflows)? Spring Controller to do the routing and ForwardComposer to handle the ajax behaviors (ie events)?
question 3:
i'm using listbox in this but i would need to do things from context menu on selected object.do you thing grid is suitable for it?
thanks for reading this.
Nobody? :(
you better make sure you get the right object,
you can simply add ${result} on the zul, then it will print out the object
Asked: 2011-04-20 12:16:42 +0800
Seen: 454 times
Last updated: May 01 '11