-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello Everybody
I am new here ant i have few problems using listbox component.
In fact, i want to disable a listbox, but when i do, it becomes invisible.
Can someone please help me ?
Hey there,
So, in other words, you want the read-only feature for listbox?
So that when the listbox it´s read-only, the user can see the selected item text, but can´t change it?
/Madruga
I'm glad to get feedback so quickly !!
I have tried to use disabled="true" but this doesn't work, the listbox gets simply invisible.
Maybe this is because i didn't use rows="1" and mold="select". I'm gonna try this and let you know.
You will get some different behavior out of the listbox depending upon which "mold" you are in. mold="select" means you have a single row drop-down list. In this case you don't need to specify the number of rows since it is implicit. If mold does not equal select then you do need to tell it how many rows you want the listbox to show. For example :
<listbox width="250px" rows="5"/>
In this case it will show 5 rows.
If you do not specify mold="select" and you do not give it a number of rows the listbox will not show up.
I recommend you use the live demo to see sample code and test out different things to see what works and what does not, this tool is invaluable.
http://www.zkoss.org/zkdemo/userguide/
Hello,
I have a quite similar problem. First I tried to disable the listbox in total by lbUsersTest.setDisabled(true) but that doesn't work. But I can disable the rows, respective <z:listitem> by looping over all items of the listbox and disable each of them. But my expectation of setDisable(true|false) is to disable a component in total and all its childs so that all events - specially selection clicks - are deactivated.
Am I right with my expectation?
As described before by someone else <...mold="select" > setDisabled() works but I loose all my columns, just one is kept !
Has anyone out there found a solution??
Thanks
<z:listbox width="99%" id="lbUsersTest" height="100px" disabled="true">
<z:listhead sizable="true">
<z:listheader label="Name" sort="auto" width="33%" />
<z:listheader label="Email" sort="auto" width="33%" />
<z:listheader label="Mail-In-Address" sort="auto" width="3%" />
</z:listhead>
<z:listitem disabled="true">
<z:listcell label="11"/><z:listcell label="12"/><z:listcell label="13"/>
</z:listitem>
<z:listitem>
<z:listcell label="21"/><z:listcell label="22"/><z:listcell label="23"/>
</z:listitem>
</z:listbox>
Asked: 2008-07-08 16:33:41 +0800
Seen: 211 times
Last updated: Jul 30 '08