Highlighted

Need help with reading Lists' data

ran_b-7it1qZ

01-10-2008

Hi there, I need to know how to read data from list after
transferring items by dragging from another list.

I'm able to drag and drop items from one list to another.
But, I dont know how to read the transferred data. I have tried to
use the rowcount of the list to see if it really passes the items (
and it always comes out 8? event though there's just one item on
the list), even tried to use list1.data or datalist - none comes
helpful.



The idea is - to show one list (on the left) and another
empty list on the right. The user will drag the desired items from
the list on the left to the second list on the right. When finished
- click Create! - this button's suppose to pass the values\labels
(I couldn't care which) to an ASP server .... In the following code
I always receive "null".

Any help?

By the way - Where is the "Attach Code" button? What's the
syntax?!



The drags works perfectly - I don't see [object] [Object] -
but the same text is transferred, which is great! 🙂



//This Function sets the first list - get data from XML using
HTTPService

public function init(event:ResultEvent):void

{

var topicsXml:String = event.result.toString();

//Alert.show(topicsXml,"valueof");



var arrayOfString:Array=topicsXml.split(',');

var lenArray:int = arrayOfString.length;

var arrayOfObject:Array;

arrayOfObject = arrayOfString.map(toObject);

list1.dataProvider=arrayOfObject;



}

private function toObject(element:String, index:int,
arr:Array):Object {

return {label: element};

}



Second List items are simply dragged onto it.

Now, as I said - I tried to pass using HTTPService (passing
strings using POST method):

workshoplist.listData.label.toString()

OR just Data Or dataProvider OR selectedItems.



How can I read all existing objects on the new list?