I can imagine why it does not work when you populate list from Java
Script. But it does not work even if you use the Java version of list
and do getSelected() or getSelectedIndex() on CSpJavaList. It even
does not work when you do something like:
CSpJavaList _list = ...... some list object ....
_list.addSelectable(string, CSpValue);
_list.select(0);
int i = _list.getSelectedIndex();
'i' is always -1 vhen any dynamically added list item is selected (clicked
on, or from code).
I looked onto List object in debugger - after select() method call, the
appropriate List child is
set selected=true. But once I run over getSelectedIndex(), it is reset again
to selected=false.
So it looks like the workaround is to use a peer List and its events in case
of Java and cgi-variables
in case of HTML to get the index of the list item. Then use that index to
retrieve CSpValue
object from CSpList.....
Can somebody comment on it (suggest a better way or point I am missing).
Thank You
Alex Balaban
Nortel Networks
> -----Original Message-----
> From: Rodney Waldhoff [SMTP:[EMAIL PROTECTED]]
> Sent: Sunday, May 09, 1999 2:51 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [ND] ND4.1.3 : Getting items from listbox populated from
> a javascript.
>
> If memory serves, list boxes and etc. will only treat items as selected if
>
> they were initially part of the 'populated' list. Think of it this way:
> when a POST request comes in, we scroll through each item of each list
> box.
> If that item's value was found in the POSTed cgi-variables, we flag that
> item as selected. Otherwise, we flag it as not selected.
>
> If you want to see if an item is selected that was not part of the orignal
>
> list of children for that list box for that CP, you'll need to look at the
>
> POSTed cgi variables directly, via calls to getWebVar or whatever. Since
> you're populating the list box via JavaScript, I assume this applies to
> you.
> (I.e., ND doesn't know what the possible values are)
>
> - rod
>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
> _________________________________________________________________________
>
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]