I filed a bug on this - LPP-1337 ("Should be able to determine index
of currently selected item").
jim
On Jan 13, 2006, at 11:17 AM, James Howe wrote:
Thanks for the tip. I think I can probably do something like you
describe.
One of things I'm finding frustrating with Laszlo is that there are
many things which should be simple to do, but in Laszlo they
aren't. If 'list' is going to offer a selectAt(index) method, it
would seem there should be an easy way to get the currently
selected item index. I seem to be running into this a lot lately.
Perhaps it just means I'm not doing things the 'right' way.
Thanks again for your help.
On Fri, 13 Jan 2006 12:24:37 -0500, William Krick <[EMAIL PROTECTED]
online.com> wrote:
This probably isn't exactly what you want but it might serve as
the basis
for a workaround...
When you build a list item, you can set a "value" and make it the
index.
Here's some code off the top of my head. It won't compile or
anything but
it will give you an idea what I mean...
Here's some data...
<resultset>
<result id="0" year="1989"/>
<result id="1" year="1990"/>
<result id="2" year="1991"/>
<result id="3" year="1992"/>
<result id="4" year="1993"/>
<result id="5" year="1994"/>
<result id="6" year="1995"/>
<result id="7" year="1996"/>
<result id="8" year="1997"/>
<result id="9" year="1998"/>
<result id="10" year="1999"/>
<result id="11" year="2000"/>
<result id="12" year="2001"/>
<result id="13" year="2002"/>
<result id="14" year="2003"/>
<result id="15" year="2004"/>
<result id="16" year="2005"/>
<result id="17" year="2006"/>
</resultset>
here's a combo box (I left out the datapath stuff)...
<combobox name="cb1" editable="false">
<textlistitem text="$path{'@year'}" value="$path{'@id'}" />
</combobox>
Then you can say something like...
var index = cb1.getValue();
-----Original Message-----
From: James Howe [mailto:[EMAIL PROTECTED]
Sent: Friday, January 13, 2006 11:59 AM
To: [email protected]
Subject: [Laszlo-user] Obtaining the index of an item in a list
I have a list which is constructed from XML. When a user makes a
selection I want to remember so I can use a selectItemAt call at some
point in the future. As far as I can tell, there is no way to get
the
index of a selected item in a list. Am I overlooking something?
Thanks!
--
James Howe
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
--
James Howe
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user