0

How can I get value from dynamic listbox?

asked 2014-05-14 09:52:40 +0800

teamgong gravatar image teamgong
0 1

updated 2014-05-14 09:54:54 +0800

The issue is that there have some dynamic listbox in my page, the number is saved in DB, but I can't set ID to listbox, because it's can't be the same, I want to get which listbox selected item, how can I do? Or does ZK can get value by name? such as <listbox name="**"/> Thanks a lot!

My code is below:

<zul:grid id="skillTitle" fixedLayout="true" visible="true">
<zul:columns>
    <zul:column label="Skill Name" width="50%" />
    <zul:column label="Rotation Score" width="50%" />
</zul:columns>
<zul:rows>
    <zul:row forEach="${rotation.skill_rotations_scores}" self="@{rotation.skill_rotations_scores}" visible="true">
        <zul:label value="${each.skill.skill_name}" tooltiptext="[${each.ratio.typename}] - ${each.skill.skill_name}" class="label" width="35px" />
        <zul:listbox mold="select" rows="1" width="35px">
            <zul:listitem label="5" value="${5}" />
            <zul:listitem label="4" value="${4}" />
            <zul:listitem label="3" value="${3}" />
            <zul:listitem label="2" value="${2}" />
            <zul:listitem label="1" value="${1}" />
        </zul:listbox>
    </zul:row>
</zul:rows>

</zul:grid>

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-05-17 07:50:30 +0800

nmpallas gravatar image nmpallas
115 4
http://nmpallas.wordpress...

The listbox has an attribute selectedItem which based on the data binding mechanism you are using can be binded to a parameter in your ViewModel or backing bean for your page.

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-05-14 09:52:40 +0800

Seen: 15 times

Last updated: May 17 '14

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