0

How can i make a listitem as a button? [closed]

asked 2018-01-10 19:50:28 +0800

davidpotolski gravatar image davidpotolski
3 1

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

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cor3000
close date 2018-01-22 09:13:24

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-01-11 11:03:59 +0800

cor3000 gravatar image cor3000
4143 1 7
ZK Team

updated 2018-01-11 11:05:13 +0800

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:

Robert

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2018-01-10 19:50:28 +0800

Seen: 6 times

Last updated: Jan 11

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