0

Listitem to have a radio button allowing the user to select only one item from the underlying model?

asked 2010-06-30 09:38:15 +0800

audioworm gravatar image audioworm
36 1

All,

I need each listitem to have a radio button allowing the user to select one, and one only item from the list of items. The following zul snippet appeared to work, can any body let me know if there any problems with this code, or better still let me know if there's a better way of doing this.


<radiogroup>
<listbox id="processesListbox" mold="paging" pageSize="5" model="@{processswin.installedProcesses}">
<listhead sizable="true">
<listheader width="2%"/>
<listheader label="Description" width="99%"/>
</listhead>
<listitem self="@{each=process}">
<listcell>
<radio/>
</listcell>
<listcell label="@{process.name}"/>
</listitem>
</listbox>
</radiogroup>


Regards
Tony

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-07-01 01:00:27 +0800

jaikarthik gravatar image jaikarthik
69

<zk>
<listbox id="box" fixedLayout="true" multiple="false" checkmark="true">
<listhead>
<listheader label="Name"/>
<listheader label="Gender"/>
<listheader label="Age"/>
<listheader label="Description"/>
</listhead>
<listitem>
<listcell label="Mary"/>
<listcell label="FEMALE"/>
<listcell label="18"/>
<listcell label="A young lady."/>
</listitem>
<listitem>
<listcell label="John"/>
<listcell label="MALE"/>
<listcell label="20"/>
<listcell label="A college student."/>
</listitem>
<listitem>
<listcell label="Jane"/>
<listcell label="FEMALE"/>
<listcell label="32"/>
<listcell label="A remarkable artist."/>
</listitem>
<listitem>
<listcell label="Henry"/>
<listcell label="MALE"/>
<listcell label="29"/>
<listcell label="A graduate."/>
</listitem>
</listbox>

</zk>

just set multiple attribute to false in ur listbox to have radio button

link publish delete flag offensive edit

answered 2010-07-01 01:36:57 +0800

audioworm gravatar image audioworm
36 1

jaikarthik,

Thanks for your help, that's exactly what I'm looking for.

Regards
Tony

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: 2010-06-30 09:38:15 +0800

Seen: 254 times

Last updated: Jul 01 '10

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