-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have this .zul page:
<?xml version="1.0" encoding="UTF-8"?> <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="./articulo"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <div id="articulo" height="100%" apply="${articulo}" xmlns="http://www.zkoss.org/2005/zul"> <borderlayout> <north> <hbox> <label value="Codigo Producto"/> <textbox value="@{articulo$composer.ejemplo.codigo}"/> <label value="Nombre Producto"/> <textbox value="@{articulo$composer.ejemplo.nombre}"/> <button id="search" label="Buscar"/> </hbox> </north> <center border="none" flex="true"> <listbox id="articuloBox" span="true" model="@{articulo$composer.list; load-when:search.onClick}" selectedItem="@{articulo$composer.selected}"> <listhead sizable="true"> <listheader label="Codigo" sort="auto" /> <listheader label="Nombre Articulo" sort="auto" /> <listheader label="Stock" sort="auto" /> <listheader label="Valor" sort="auto" /> <listheader label="Descripcion" sort="auto" /> </listhead> <listitem self="@{each='articulo'}" value="@{articulo}"> <listcell label="@{articulo.codigo}" /> <listcell label="@{articulo.nombre}" /> <listcell label="@{articulo.stock.cantidad}" /> <listcell label="@{articulo.valor}" /> <listcell label="@{articulo.descripcion}" /> </listitem> </listbox> </center> <south> </south> </borderlayout> </div>
the listbox don't load the list from model somebody can help me?
Should it be
apply="@{articulo}"
@steva77: yesss, maybe problem nr. 1 (same name for item and controller)
Problem nr 2, maybe a timingproblem
model="@{articulo$composer.list; load-when:search.onClick}"
Because the default for the inputfields (.codigo, nombre) are "save-when=onChange" it might be work, but if you i.e. logic inside onClick$search is executed after the reload!
so try: model="@{articulo$composer.list; load-after:search.onClick}"
Asked: 2011-04-15 12:19:13 +0800
Seen: 471 times
Last updated: Apr 18 '11