0

Checkbox not showing in listheader when checkmark and multiple are true

asked 2016-08-02 21:22:49 +0800

scottz gravatar image scottz
1

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?

delete flag offensive retag edit

Comments

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

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-03 06:02:56 +0800

chillworld gravatar image chillworld flag of Belgium
5143 3 9
https://github.com/chillw...

You are loading a ListModel and not a List.
You need to set the multiple in code on your ListModelList : setMultiple(true)

Greetz chill.

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2016-08-02 21:22:49 +0800

Seen: 25 times

Last updated: Aug 03 '16