-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm attempting to add a checkbox to the header of a listbox. From the documentation I've seen, the below code should do just that. It does put a checkbox with each item, bit it does not put a checkbox in the listheader. We are running zk 6.5.8.1.
<listbox
model="@load(vm.incidentReport.irImages)"
emptyMessage="No Image Data"
checkmark="true"
multiple="true"
id="picturesListBox"
selectedItems="@bind(vm.selectedImages)">
<listhead>
<listheader label="You are using ZK version: ${desktop.webApp.version}" />
<listheader label="Description" />
<listheader label="Type" />
<listheader label="Date Added/Updated" />
<listheader />
</listhead>
<template name="model">
<listitem hflex="1" height="150px">
<listcell label="@load(each.title)" />
<listcell label="@load(each.description)" />
<listcell label="@load(each.type)" />
<listcell label="@load(each.createdTs) @converter('dateTimeFormatConverter')" />
<listcell vflex="max" height="150px" zclass="blah">
<image src="@load(vm.getImageSrc(each))" style="max-height:100px;" />
</listcell>
</listitem>
</template>
</listbox>
I've grabbed the fiddle from here: zkfiddle.org/sample/1q5ffui/1-Select-multiple-items-in-listbox-with-model
and modified it for checkmark=true (which worked as expected) and then imported it into our environment and the checkmark in the listheader disappeared.
The checkmark is not visible when I inspect the elements on the page, so it's not just there, but hidden.
I expect that we've got something set up in our environment that disables/removes that checkbox, but I have had no luck finding the offending css/code/whatever. Anyone have any thoughts?
You are loading a ListModel
and not a List
.
You need to set the multiple in code on your ListModelList
: setMultiple(true)
Greetz chill.
Asked: 2016-08-02 21:22:49 +0800
Seen: 32 times
Last updated: Aug 03 '16
The problem was that in zk.xml we have the following: <library-property> <name>org.zkoss.zul.listbox.rod</name> <value>true</value> </library-property> Once I set that value to false in a custom attribute on the specific pages where it is needed, the checkbox appeared as desired.
scottz ( 2016-08-04 15:41:11 +0800 )edit