-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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>
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.
Asked: 2014-05-14 09:52:40 +0800
Seen: 18 times
Last updated: May 17 '14