![]() |
![]() |
||||||
|
|||||||
| Tags: comma, delimited, list, mxlist |
![]() |
|
|||
|
you can use
list.selectedItems.join(","); if you want to insert the selected items into database, i don't think making a comma delimited string is appropriate, you might have thought to parse this string in the server side again, but you can pass the list itself to a server script. |
|
|||
|
The selectedItems seems to work, but I am getting object, object. The list is
set to: <mx:List id="frmProjectTeam" allowMultipleSelection="true" height="110" width="100%" labelField="name"> </mx:List> The dataProvider is being set in a function that populates it with a 'name' and a uniqname (username). How can I create the list based on the uniqnames selected? I tried: projectInfo.assigned = frmProjectTeam.selectedItems.uniqname.join(","); |
|
|||
|
selectedItems is an array of *objects*. [Object object] happens when you
attempt to display an object in a component that is expecting a string. You need to specify the name of the property in the object that contains the string value you want to use. Tracy |
|
|||
|
Thanks for the help. Sorry I am such a novice:
I tried these, but failed. How off the mark am I? public function getTeamList(team:Array):String { var teamMembers:String; for (var i:Number = 0; i < team.length; i++) { teamMembers += team[i].uniqname; } return teamMembers; } private function createProject():void { var projectInfo:Object = new Object(); projectInfo.assigned = getTeamList(frmProjectTeam.selectedItem.data); projectDAO.create({projectData rojectInfo});} |
|
|||
|
Close, the first should work. Try this, modified a bit for clarity:
Tracy public function getTeamList():String { var aSelectedTeams:Array = frmProjectTeam.selectedItems; var teamMembers:String = ""; //need to init this or the first += will error for (var i:Number = 0; i < aSelectedTeams.length; i++) { teamMembers += aSelectedTeams[i].uniqname; } return teamMembers; } |
|
|||
|
I get 'undefined, undefinded, undefined' as my insert value. Do I have to add a
value to the var aSelectedTeams:Array = frmProjectTeam.selectedItems; such as var aSelectedTeams:Array = frmProjectTeam.selectedItems.uniqname; or something. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise