0

Listbox model and row index

asked 2010-05-12 16:06:56 +0800

Arsen gravatar image Arsen
384 5

Good day, everyone.

<listbox id="paymentsList" fixedLayout="true">
                    <listhead>
                        <listheader label="Number" width="40px" />
                        <listheader label="Account" width="100%"/>
                        <listheader label="Sum" width="100px"/>
                        <listheader label="Paydate" width="100px"/>
                        <listheader label="" width="40px"/>
                    </listhead>
                    <listitem self="@{each=payment}" >
                        <listcell label="@{self.parent.index}"/>
                        <listcell label="@{payment.account.account}"/>
                        <listcell label="@{payment.pay}"/>
                        <listcell>
                            <datebox value="@{payment.payDate}" width="75px" />
                        </listcell>
                        <listcell>
                            <button image="/images/delete 16.png" />
                        </listcell>
                    </listitem>
                </listbox>

This listbox gets model from java code. I want column named "Number" contains 1-based index of listitem, but

listcell label="@{self.parent.index}"/>

gives me 0-based index.
What should I do?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-05-19 23:52:27 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi Arsen,
Not sure how to do it by just using @{self.parent.index} but you can easily put a 1-based "index" field in your data model and use data binding to display it.

Thanks
- Ashish

link publish delete flag offensive edit

answered 2010-07-22 15:37:11 +0800

intoxicadocoder gravatar image intoxicadocoder
57 1 1 4

which is the way to do it in grid?

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: 2010-05-12 16:06:56 +0800

Seen: 792 times

Last updated: Jul 22 '10

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