0

Databinding for a combobox

asked 2009-12-08 09:57:15 +0800

rolo gravatar image rolo
15 1 1

Hi forum,

i have a problem with databinding for a combobox.

First here is my zul file:

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./popup_add_contact_person" ?>
<?page title="popup_add_contact_person" contentType="text/html;charset=UTF-8"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk>
<window id="popup_add_contact_person">
<combobox width="132px"
id="familystate" onCreate="familystate.setSelectedIndex(0)"
value="@{popup_add_contact_person.person.familystate}">
<comboitem
label="${c:l('cm.combolist.familystate0')}">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate1')}"
value="SINGLE">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate2')}"
value="MARRIED">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate3')}"
value="SEPARATED">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate4')}"
value="DIVORCED">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate5')}"
value="WIDOWED">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate6')}"
value="ENGAGED">
</comboitem>
<comboitem
label="${c:l('cm.combolist.familystate7')}"
value="COHABITATING">
</comboitem>
</combobox>
</window>
</zk>

The promlem is, that the databinder takes the label="" -values but not the value="" -values from the items, to bind to my person.
Is this a bug? Or have I misunderstood the function?

Greetings
rolo

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-12-08 14:50:40 +0800

rolo gravatar image rolo
15 1 1

No ideas. In my opinion the databinder should make the person.familystate to combobox.value. Or not?

link publish delete flag offensive edit

answered 2009-12-08 18:56:12 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi,rolo
you can refer to here

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: 2009-12-08 09:57:15 +0800

Seen: 256 times

Last updated: Dec 08 '09

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