James,

I have been trying to get this done as well. here is what i have

<method event="onselect">
                                        Debug.write('$$selected$$');
                                        parent.menu.details.onclick.sendEvent();
                                </method>
                                <method event="ondata">
                                        grid.selectItemAt(0);
                                </method>

but it does not work. in the debug window i see that the selected
attribute is set.

so i will be watching this thread.

Vikas.

On 1/9/06, James Howe <[EMAIL PROTECTED]> wrote:
> 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