Unsupported child for Listbox: <Listcell null>

asked 2023-04-24 22:44:40 +0800

darent gravatar image darent

updated 2023-04-24 22:47:37 +0800

Hello, I'm just trying to bind some datas from my Implements class: public class PrestacionesDAOImpl implements PrestacionesDAO{

private List<Prestaciones> prestacionesList= new LinkedList<Prestaciones>();
private int id = 1;

public PrestacionesDAOImpl() {
    prestacionesList.add(new Prestaciones(id++, "First", "Uno", 27));
    prestacionesList.add(new Prestaciones(id++, "Second", "Dos", 23));
    prestacionesList.add(new Prestaciones(id++, "Third", "Tres", 24));
    prestacionesList.add(new Prestaciones(id++, "Fourth", "Cuatro", 60));
    prestacionesList.add(new Prestaciones(id++, "Fifth", "Cinco", 60));
    prestacionesList.add(new Prestaciones(id++, "Sixth", "Seis", 2));

Into my index.zul, in a listbox: <zk> <window title="Principal" border="normal" apply="com.springzk.pruebazk.controller.IndexController">

<hbox align="center">
    <textbox id="keywordBox"/>
    <button id="searchButton" label="Buscar"/>

<listbox id="prestListbox" emptyMessage="No se ha encontrado nigún registro" rows="10">
        <listheader label="Nombre"/>
        <listheader label="Apellidos"/>
        <listheader label="Edad"/>
    <template name="model">
        <listcell label="${each.nombre}"></listcell>
        <listcell label="${each.apellidos}"></listcell>
        <listcell label="${each.edad}"></listcell>

</window> </zk>

with my IndexController:

public class IndexController extends SelectorComposer<component>{

private static final long serialVersionUID = 1L;

private Textbox keywordBox;

private Listbox prestListbox;   

private ListModelList<Prestaciones> list = new ListModelList<>();   
private PrestacionesDAO dao = new PrestacionesDAOImpl();

public void doAfterCompose(Component comp) throws Exception {


@Listen("onClick = #searchButton; onOK = window")
public void search() {
    String keyword = keywordBox.getValue();
    List<Prestaciones> result = dao.search(keyword);
    prestListbox.setModel(new ListModelList<Prestaciones>(result));
    System.out.println("\nSe han encontrado: " + result.size() + " registros.");


But when i search for a data, I get a "org.zkoss.zk.ui.UiException: Unsupported child for Listbox: <listcell null="">", and I don't know why..

Someone can help me? thank you so much.

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
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




Asked: 2023-04-24 22:44:40 +0800

Seen: 3 times

Last updated: Apr 26

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