-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I’m using MVC with ZK 7.0.3. I populate a Listbox with ListModelList. I click one list item for further processing. The problem is that from element number 51 towards the Listbox does not respond to the click event. What coud be the cause?
Here is a code snipet from my controller:
List<Farmaco> farmacos = DAOs.getFarmacoDAO().findAll();
ListModelList<Farmaco> farmacoModel = new ListModelList<Farmaco>(farmacos);
farmacoList.setModel(farmacoModel);
[...]
Then . . .
@Listen("onClick=#farmacoList listitem listcell button")
public void addFarmaco(Event fe) {
if (!(fe.getTarget() instanceof Button)) {
return;
} else {
Button btn = (Button) fe.getTarget();
String strId = btn.getId();
Farmaco farmaco = DAOs.getFarmacoDAO().buscaId(strId);
...
A snipet from the zul:
<groupbox width="424px" mold="3d" id="farmaco">
<caption label="Fármacos" />
<listbox id="farmacoList">
<listhead sizable="true">
<listheader
image="/image/Bullet-10x10.png" align="center" width="7%" />
<listheader label="Descrição" width="60%" />
<listheader label="Preço" align="right" width="18%" />
<listheader label="Add" width="16%" align="center" />
</listhead>
<template name="model">
<listitem value="${each}">
<listcell>
<image src="/image/Bullet-10x10.png" />
</listcell>
<listcell>
<label value="${each.descricao}" />
</listcell>
<listcell label="${(each.precoCashCompF)}">
</listcell>
<listcell>
<button image="/image/AddSquare-16x16.png" id="${(each.id)}" />
</listcell>
</listitem>
</template>
</listbox>
</groupbox>
I’ve tried a grid with the same result. Thanks in advance.
Asked: 2016-10-01 19:48:19 +0800
Seen: 24 times
Last updated: Oct 01 '16
Try renderAll on the listbox after setting model
chillworld ( 2016-10-01 21:04:32 +0800 )edit