0

Listbox does not respond to the click event

asked 2016-10-01 19:48:19 +0800

ntsetso gravatar image ntsetso
59 1 4

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.

delete flag offensive retag edit

Comments

Try renderAll on the listbox after setting model

chillworld ( 2016-10-01 21:04:32 +0800 )edit
Be the first one to answer this question!
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-10-01 19:48:19 +0800

Seen: 24 times

Last updated: Oct 01 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More