-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.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!!!
Since you are using the "old" deprecated binding syntax @{...}
you'll find it hard to get any forum useful response or find documentation about it.
As an alternative I created an example on zkfiddle using a ListModelList (not BindListModelList) in combination with a <template name="model">
to render the <listitems>.
I hope this will help to avoid the deprecated syntax.
Robert
Asked: 2017-07-10 19:18:07 +0800
Seen: 24 times
Last updated: Jul 11 '17
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate
can you please describe what your desired result is. preferably provide a running example on https://zkfiddle.org
cor3000 ( 2017-07-11 01:36:21 +0800 )edit