-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I wanted to make a listbox as if their listitens were buttons. I use href on my system's buttons to change screens and need to have the same function on my listitems
Hi David,
the first things that come to my mind are adding onClick
listeners (client side / server side) to the listitems or add an link inside a listcell.
<zk xmlns:w="client">
<listbox>
<listitem label="1. redirect via server-side listener (might triggers popup blocker)"
onClick='Executions.getCurrent().sendRedirect("somepage.zul", "_blank");'/>
<listitem label="2. redirect via client side listener"
w:onClick="window.open('somepage.zul', '_blank');"/>
<listitem>
<listcell>
<a label="3. link with a=href" href="somepage.zul" target="_blank"/>
</listcell>
</listitem>
</listbox>
</zk>
Finally I wonder why you chose listbox for that purpose and make each item act like a button. If you wanted to render just a list of <button>
s based on a Collection that's possible without <listbox>
:
in ZK CE with:
in ZK EE:
<forEach>
Robert
Asked: 2018-01-10 19:50:28 +0800
Seen: 7 times
Last updated: Jan 11 '18