-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have a listbox with attributes multiple="true" and checkmark="true".
When the listbox is created (with no items because items only appears when a button is clicked) the checkmark to select multiple items is displayed in the listheader.
But when I fill the listbox with data (binder.loadComponent(LBFicheros)) the checkbox disappears and a radiobutton is displayed in each row. I checked if the listbox for some reason changes to multiple="false" but is not so, listbox is still multiple.
Any idea why is this happening?
My listbox:
<listbox id="LBFicheros" multiple="true" checkmark="true" width="100%" vflex="1" mold="paging" autopaging="true" model="@{VentanaFicheros$composer.listaBeans}"> <listhead sizable="true"> ... </listhead> <listitem id="fila" self="@{each=ServidorBean}" value="@{ServidorBean}"> <listcell label="@{ServidorBean.Tabla}" tooltiptext="@{ServidorBean.Tabla}" style="text-align:left;white-space:nowrap"/> .... </listitem> </listbox>
I haven't used ListModelList directly yet, I always pass an ordinary Java List (ArrayList).
I think you need to set multiple flag on that ListModelList before you provide it to the ZK binding.
Yes, this looks ok. Do you use ZK6 release?
And how does your getItems() looks like?
Ok, I reproduce your listbox:
<listbox id="LBFicheros" multiple="true" model="@load(vm.items)" selectedItems="@bind(vm.selected)">
I repeat that setting multiple to listmodellist works.
Things changed during the ZK6 development. Currently my multi-selection listboxes look like the following:
<listbox multiple="true" selectedItems="@bind(vm.selectedEntries)" model="@load(vm.entries)">
I'm changing to ZK6 binding.
Matze2 said that with ZK6 Bind if selectedItems are bind multiple="true" is set automatically.
I tried it and multiple="true"wasn't set.
So I hope some of you can help me finding what I'm not doing well:
This is my listbox:
<listbox nonselectableTags="*" id="LBFicheros" multiple="true" checkmark="true" mold="paging" autopaging="true" model="@load(vm.items)" selectedItems="@bind(vm.selected)">
private Set <ServidorBean> selected; public Set<ServidorBean> getSelected() { System.out.println("Entra en getSelected"); return selected; } public void setSelected(Set<ServidorBean> selected){ System.out.println("Entra en setSelected"); this.selected = selected; }
With this code multiple selection is not enabled and radiobuttons are shown instead of checkboxes.
If I set multiple="true" in the ListModelList it works OK but I understood (maybe I'm wrong) that it is not necessary if selectedItems are binded.
Asked: 2012-01-05 09:00:26 +0800
Seen: 1,424 times
Last updated: Feb 21 '12