Daphine,

You can get a list of all selected values by using the CSpSelectable method 
getSelectedList().

//This would be a ComboBox or ListBox
CSpSelectable seletable  =
 (CSpSelectable)getDisplayField("ListBoxName");

//getSelectedList returns a List of CSpListItems
java.util.Vector list = seletable.getSelectedList();
CSpListItem item = (CSpListItem)list.elementAt(0);
String label = item.getLabel();
CSpValue v   = item.getValue();
etc..


Are you populating the ListBox via JavaScript? The reson I ask is in the event that
         this selectable group is populated from a DB table or DataObject from with ND 
you
         could take the approach of retreving a handle to the CSpAutoFillControl 
associated
         with that instance of the ListBox. CSpAutoFillControl will allow you to read 
the
         contents of a selectable.

If the above is not the case you may want to use String concatnation to accomplish the 
same effect.

Explanation:

place a hidden field on the page, each time the user adds to the list box visual 
display
         the value in the list box to let the user know that the option was accepted, 
when
         actually behind the scenes your are creating a delimeted string 
representation of
         the total contents of the list box and storing the value in a hidden field. 
When
         the page is submitted to the app-server get a handle to the hidden field and 
read
         the contents that way.

Hope this helps


etc...

Or if you would like to get a list of all the entire contents of the ListBox use:

 

"Daphne Yue" <[EMAIL PROTECTED]> wrote:
>
>Hi
>
>I have a ListBox that is dynamically updated by javascripts.
>When the page is sent back to the server, I need to get all the items
>listed in the ListBox.
>
>getDisplayFieldValue only returns selected items.  I need all items.
>
>Any suggestions how I can do this?
>
>Thanks.
>
>
>

_________________________________________________________________________

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]

Reply via email to