0

ListBox Dont load list from model !!!!

asked 2011-04-15 12:19:13 +0800

tomarts gravatar image tomarts
45 1

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?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-04-18 02:37:35 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Should it be

apply="@{articulo}"
?

link publish delete flag offensive edit

answered 2011-04-18 09:42:00 +0800

robertpic71 gravatar image robertpic71
1275 1

@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}"

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2011-04-15 12:19:13 +0800

Seen: 471 times

Last updated: Apr 18 '11

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