Revision history [back]

click to hide/show revision 1
initial version

asked 2017-07-10 19:18:07 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of

Zk 6.5.3 Listbox macrocomponent

Hello i have a macrocomponent like this.

<!-MACROCOMPONENT zul extension->
<listbox id="results">
<listitem id='listitem' self="@{each=d}">
    <listcell label='@{d.column1}'/>
            <listcell label='@{d.column2}'/>
            <listcell label='@{d.column3}'/>  
            <listcell label='@{d.column4}'/>
</listitem>
 </listbox>

I set set model using BindingListModelList just as a regular listbox.

The listbox is render but only the 1 column and shows the toString method of the adapter.

final List<Students>students = ...........
results.setModel(new BindingListModelList<>(students,false));

And then show the toString() method of the Student class.

I have try this syntax

<listitem id='listitem' self="@{each=${arg.adapters}}">

And the HTMLMacroComponent class has a method getAdapters with returns the data to show.

public List<Students>getAdapters(){
    return adapters;
}

But i couldn;t make it work!!!

Zk 6.5.3 Listbox macrocomponent

Hello i have a macrocomponent like this.

<!-MACROCOMPONENT zul extension->
<listbox id="results">
<listitem id='listitem' self="@{each=d}">
    <listcell label='@{d.column1}'/>
            <listcell label='@{d.column2}'/>
            <listcell label='@{d.column3}'/>  
            <listcell label='@{d.column4}'/>
</listitem>
 </listbox>

I set set model using BindingListModelList just as a regular listbox.

The listbox is render but only the 1 column and shows the toString method of the adapter.

final List<Students>students = ...........
results.setModel(new BindingListModelList<>(students,false));

And then show the toString() method of the Student class.

I have try this syntax

<listitem id='listitem' self="@{each=${arg.adapters}}">
self="@{each=${arg.includer.adapters}}">
        <listcell label='${arg.includer.adapters[self.columIndex].column1}'/>
        <listcell label='${arg.includer.adapters[self.columIndex].column2}'/>
        <listcell label='${arg.includer.adapters[self.columIndex].column3}'/>
        <listcell label='${arg.includer.adapters[self.columIndex].column4}'/>
</listitem>

And the HTMLMacroComponent class has a method getAdapters with returns the data to show.

public List<Students>getAdapters(){
    return adapters;
}

But i couldn;t make it work!!!

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