0

Zk 6.5.3 Listbox macrocomponent

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

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

updated 2017-07-10 20:35:59 +0800

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!!!

delete flag offensive retag edit

Comments

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

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-07-11 07:39:56 +0800

cor3000 gravatar image cor3000
4596 2 7
ZK Team

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

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

Follow
1 follower

RSS

Stats

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

Seen: 24 times

Last updated: Jul 11 '17

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