Dan Stowell helped me out with this problem about a week ago right here in
the mailing list.  I've attached his solution to my problem.  Note that the
external dataset links to my website and that content may not always be
there.  Just in case it stops working.



-----Original Message-----
From: James Howe [mailto:[EMAIL PROTECTED]
Sent: Monday, January 09, 2006 11:34 AM
To: [email protected]
Subject: [Laszlo-user] Automatically selecting an item in a list


My Laszlo application has a list component which gets populated from a
data set.  The first time the list loads, I would like to automatically
select the first item in the list.  I've tried adding an 'ondata' event
handler for the list which does something like this:

selectAt(1);

However, I have code which handles things when an item is selected and
this code is complaining that the selected object is null.  This makes me
think that I'm my handling of the ondata event is occuring before all the
items in the list are built.  Is this a correct assumption?  If so, what
is the proper way to handle this?  Ideally I would want something like
this:

1. List is populated with data from XML for the first time.
2. First item in list is automatically selected.
3. List is repopulated with updated data from XML
4. If a selection already exists (and still exists in the list) leave it
selected, otherwise select the first item.

Are there examples somewhere which might give me a better idea on how to
handle this?

Thanks!

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

Reply via email to