0

Deep DataBinding

asked 2007-09-15 09:17:06 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4519768

By: onlytre

im new to zk so please excuse me for the (maybe) simple question.


i need to access to collections element in another collection of element

snippets of my classes:

class person{


Set emails;

}

class email{

String address;

}

this modified example (databind 4) doesnt work for me, i cant access the email collection inside a person object


please help me and if possible provide some code.


<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?> <window xmlns:a="http://www.zkoss.org/2005/zk/annotation">
<a:bind model="persons" selectedItem="selected"/>
<listbox rows="4">
<a:bind _var="person"/>
<listitem>
<a:bind label="person.firstName"/>
<listcell/>
<a:bind label="person.lastName"/>
<listcell/>
<listcell>
<a:bind model="person.emails">
<listbox rows="1"/>
<a:bind _var="email"/>
<listitem>
<a:bind label="email.address"/>
<listcell/>
<listitem>
</listbox>
</listcell>
</listitem>
</listbox>
<!-- show the detail of the selected person -->
<grid>
<rows>
<row>First Name: <a:bind value="selected.firstName"/><textbox/></row>
<row>Last Name: <a:bind value="selected.lastName"/><textbox/></row>
<row>Email: <a:bind value="selected.email"/><label/></row>
</rows>
</grid>
</window>


delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2007-09-15 14:44:53 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4520015

By: robbiecheng

Did you specify a getEmails() method in you Person Class?

/Robbie

link publish delete flag offensive edit

answered 2007-09-16 16:17:32 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4521005

By: onlytre

obviously yes, maybe the problem is with Hibernate and lazy loading of emails collection?

link publish delete flag offensive edit

answered 2009-11-13 02:09:29 +0800

kyc gravatar image kyc
54 1

pls set lazy="false" in hibernate, I encountered the same problem before

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: 2007-09-15 09:17:06 +0800

Seen: 310 times

Last updated: Nov 13 '09

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