Search Results

Search found 119 results on 5 pages for 'arraycollection'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • How do i pass arraycollection to Advancedatagrid using HierarchicalData ?

    - by R.Vijayakumar
    Problem with passing arraycollection to Advance datagrid. My Arraycollection structure like `   private var groupList:ArrayCollection = new ArrayCollection([ {Country:'India', children:[ {Country:'Series1', children:[                                {Matches:'India Test series 1',isEnable:false,id:1,isSelected:true},                                {Matches:'India Test series 2',isEnable:false,id:2,isSelected:true},                                {Matches:'India Test series 3',isEnable:false,id:3,isSelected:true}]},              {Country:'Series2', children:[                                {Matches:'Australia Test series 1',isEnable:false,id:25,isSelected:true},                                {Matches:'Australia Test series 2',isEnable:false,id:26,isSelected:true},                                {Matches:'Australia Test series 3',isEnable:false,id:27,isSelected:true}]} ]}, {Country:'Austrila', children:[ {Country:'Series1', children:[                                {Matches:'Australia Test series 1',isEnable:false,id:46,isSelected:true},                                {Matches:'Australia Test series 2',isEnable:false,id:47,isSelected:true},                                {Matches:'Australia Test series 3',isEnable:false,id:48,isSelected:true}]}, {Country:'Series2', children:[                                {Matches:'Australia Test series 1',isEnable:false,id:49,isSelected:true},                                {Matches:'Australia Test series 2',isEnable:false,id:50,isSelected:true},                                {Matches:'Australia Test series 3',isEnable:false,id:51,isSelected:true}]}, {Country:'Series3', children:[                                {Matches:'Australia Test series 1',isEnable:false,id:52,isSelected:true},                                {Matches:'Australia Test series 2',isEnable:false,id:53,isSelected:true},                                {Matches:'Australia Test series 3',isEnable:false,id:54,isSelected:true}]} ]} passing AD in dataProvider="{new HierarchicalData(groupList)}" It's working fine. it's show two menu of tree and childrens based on country .But i tried dynamic xml convert to Arraycollection by below code private function convertXmlToArrayCollection( file:String ):ArrayCollection { var xml:XMLDocument = new XMLDocument( file ); //var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(); var decoder1:SimpleXMLDecoder = new SimpleXMLDecoder(true); var data1:Object = decoder1.decodeXML( xml ); var array1:Array = ArrayUtil.toArray(data1); return new ArrayCollection( array1 ); } my xml structure is <Country Country="India "> <Country Country="Series "> <Matches Matches="BIndependiente-Colon" id="701536" isEnable="false" isSelected="true" startDate="2009-10-29 01:30:00" EndDate="2009-10-29 01:30:00"/> <Matches Matches="Boca Juniors-Chacarita Juniors" id="701633" isEnable="false" isSelected="true" startDate="2009-10-29 19:00:00" EndDate=""/> </Country> </Country> <Country Country="Australia"> <Country Country="series"> <Matches Matches="BIndependiente-Colon" id="701536" isEnable="false" isSelected="true" startDate="2009-10-29 01:30:00" EndDate="2009-10-29 01:30:00"/> <Matches Matches="Boca Juniors-Chacarita Juniors" id="701633" isEnable="false" isSelected="true" startDate="2009-10-29 19:00:00" EndDate=""/> </Country> </Country> So if i tried to convert this format of xml code to arryacollection , it converted the array collection but when will i pass to Advance data grid it not show any result . What did i wrong ? groupList1= convertXmlToArrayCollection(string1); Alert.show(groupList1[0].Country[0].Matches[0].id.toString());// output is =701536 Where did i mistake it ? Plz kindly any one refer me , What will i changed ?

    Read the article

  • Two Objects created with the same Address in Flex

    - by James
    Hi, I have an issue in flex which is causing a bit of a headache! I am adding objects to an ArrayCollection but in doing so, another ArrayCollection is also picking up these changes even though there is no binding occurring. I can see from the debug that the two ACs have the same address but for the life of me can't figure out why. I have two Array Collections: model.index.rows //The main array collection model.index.holdRows //The array collection that imitates the above This phantom data binding occurs only for the first iteration in the loop and for all others it will just write it the once. The reason this is proving troublesome is that it creates duplicate entries in my datagrid. public override function handleMessage(message:IMessage):void { super.handleMessage(message); if (message is IndexResponse) { var response:IndexResponse = message as IndexResponse; model.index.rows.removeAll(); model.index.indexIsEmpty = response.nullIndex; if (model.index.indexIsEmpty !== true) { //Update the index model from the response. Note: each property of the row object will be shown in the UI as a column in the grid response.index.forEach(function(entry:EntryData, i:int, a:Array):void { var row:Object = { fileID: entry.fileID, dadName: entry.dadName }; entry.tags.forEach(function(tag:Tag, i:int, a:Array):void { row[tag.name] = tag.value; }); model.index.rows.addItem(row); }); if(model.index.indexForNetworkView == true){ model.index.holdRows.source = model.index.holdRows.source.concat(model.index.rows.source); model.index.indexCounter++; model.index.indexForNetworkView = false; controller.indexController.showNetwork(model.index.indexCounter); } model.index.rows.refresh(); controller.networkController.show(); } } Has anyone else who has encountered something simillar propose a solution?

    Read the article

  • External data in TileList Flex

    - by Adam
    I'm working for the first time with a TileList and an itemRenderer and I'm having a bit of trouble getting the information from my array collection to display and looking for some advice. Here's what I've got private function loadData():void{ var stmt:SQLStatement = new SQLStatement(); stmt.sqlConnection = sqlConn; stmt.text = "SELECT * FROM tbl_user ORDER BY user_id ASC"; stmt.execute(); var result:SQLResult = stmt.getResult(); acData = new ArrayCollection(result.data); } <mx:TileList id="userlist" labelField="user_id" dataProvider="{acData}" width="600" height="200" paddingTop="25" left="117.15" y="327.25"> <!--itemClick="showMessage(event)"--> <mx:itemRenderer> <mx:Component> <mx:VBox width="125" height="125" paddingRight="5" paddingLeft="5" horizontalAlign="center"> <mx:Label id="username" text="{}"/> <mx:Label id="userjob" text="{}"/> </mx:VBox> </mx:Component> </mx:itemRenderer> </mx:TileList> So I'm just not sure how I go about pulling the information from the array and putting it into labels like username, userjob, userbio ect, Inside the TitleList and itemRenderer.

    Read the article

  • How to use ArrayList to store some data using ICollection

    - by Shantanu Gupta
    I want to store few strings into an array using ArrayList. How can I store all the strings at once without using Add function every time. Is it somewhat related to interface ICollection in anyway. Can I use ICollection to store my array. If yes How. ArrayList _1019=new ArrayList("TEN","ELEVEN","TWELVE","THIRTEEN","FOURTEEN","FIFTEEN","SIXTEEN","SEVENTEEN","EIGHTEEN","NINETEEN"); I want to store this in the constructor of a class in C#

    Read the article

  • How Do I Add Value To All Previous Values In Array

    - by James
    Lets say I have the following array: my_array = [1, 5, 8, 11, -6] I need to iterate over this array and add the values prior to the current value together. An example will probably be easier to understand. I need to return an array that should look something like this: final_array = [1, 6, 14, 25, 19] I have tried doing something like this: my_array.collect {|value| value + previous_values } But obviously that doesn't work because I can't figure out how to get the previous values in the array. I am a programming noob so this might be easier than I am making it. I am pretty sure I need to use either collect or inject, but I can't seem to figure out how to do this. Any help would be appreciated.

    Read the article

  • flex data provider not working if XML has single node value or less

    - by Rees
    hello, i get this error when i retrieve an XML that only has 1 node (no repeating nodes) and i try to store in an ArrayCollection. -When I have MORE than 1 "name" nodes...i do NOT get an error. My test show that XMLListCollection does NOT work either. TypeError: Error #1034: Type Coercion failed: cannot convert "XXXXXX" to mx.collections.ArrayCollection. this error occurs as the line of code: myList= e.result.list.name; Why can't ArrayCollection work with a single node? I'm using this ArrayCollection as a dataprovider for a Component -is there an alternative I can use that will take BOTH single and repeating nodes as well as work as a dataprovider? Thanks in advance! code: [Bindable] private var myList:ArrayCollection= new ArrayCollection(); private function getList(e:Event):void{ var getStudyLoungesService:HTTPService = new HTTPService(); getStuffService.url = "website.com/asdf.php"; getStuffService.addEventListener(ResultEvent.RESULT, onGetList); getStuffService.send(); } private function onGetList(e:ResultEvent):void{ myList= e.result.list.name; }

    Read the article

  • In AS3/Flex, how can I get from flat data to hierarchical data?

    - by Dave S
    I have some data that gets pulled out of a database and mapped to an arraycollection. This data has a field called parentid, and I would like to map the data into a new arraycollection with hierarchical information to then feed to an advanced data grid. I think I'm basically trying to take the parent object, add a new property/field/variable of type ArrayCollection called children and then remove the child object from the original list and clone it into the children array? Any help would be greatly appreciated, and I apologize ahead of time for this code: private function PutChildrenWithParents(accountData : ArrayCollection) : ArrayCollection{ var pos_inner:int = 0; var pos_outer:int = 0; while(pos_outer < accountData.length){ if (accountData[pos_outer].ParentId != null){ pos_inner = 0; while(pos_inner < accountData.length){ if (accountData[pos_inner].Id == accountData[pos_outer].ParentId){ accountData.addItemAt( accountData[pos_inner] + {children:new ArrayCollection(accountData[pos_outer])}, pos_inner ); accountData.removeItemAt(pos_outer); accountData.removeItemAt(pos_inner+1); } pos_inner++; } } pos_outer++; } return accountData; }

    Read the article

  • [Flex 4 and .Net] Retrieving tables from SQL database

    - by mG
    Hi everyone, As the title says, I want to retrieve tables of data from a SQL database, using Flex 4 and .Net WebService. I'm new to both Flex and DotNet. Please tell me a proper way to do it. This is what I've done so far: Retrieving an array of string: (this works) .Net: [WebMethod] public String[] getTestArray() { String[] arStr = { "AAA", "BBB", "CCC", "DDD" }; return arStr; } Flex 4: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.ResultEvent; [Bindable] private var ac:ArrayCollection = new ArrayCollection(); protected function btn_clickHandler(event:MouseEvent):void { ws.getTestArray(); } protected function ws_resultHandler(event:ResultEvent):void { ac = event.result as ArrayCollection; Alert.show(ac.toString()); } ]]> </fx:Script> <fx:Declarations> <s:WebService id="ws" wsdl="http://localhost:50582/Service1.asmx?WSDL" result="ws_resultHandler(event)"/> </fx:Declarations> <s:Button x="10" y="30" label="Button" id="btn" click="btn_clickHandler(event)"/> </s:Application> Retrieving a DataTable: (this does not work) DotNet: [WebMethod] public DataTable getUsers() { DataTable dt = new DataTable("Users"); SqlConnection conn = new SqlConnection("server = 192.168.1.50; database = MyDatabase; user id = sa; password = 1234; integrated security = false"); SqlDataAdapter da = new SqlDataAdapter("select vFName, vLName, vEmail from Users", conn); da.Fill(dt); return dt; } Flex 4: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.ResultEvent; [Bindable] private var ac:ArrayCollection = new ArrayCollection(); protected function btn_clickHandler(event:MouseEvent):void { ws.getUsers(); } protected function ws_resultHandler(event:ResultEvent):void { ac = event.result as ArrayCollection; Alert.show(ac.toString()); } ]]> </fx:Script> <fx:Declarations> <s:WebService id="ws" wsdl="http://localhost:50582/Service1.asmx?WSDL" result="ws_resultHandler(event)"/> </fx:Declarations> <s:Button x="10" y="30" label="Button" id="btn" click="btn_clickHandler(event)"/> </s:Application>

    Read the article

  • Can't add object to Array in jQuery's getJSON data function (scope issue)

    - by seo20
    I have a person object and wants to store it into a global ArrayCollection I have made. Works great in normal scope: var s = new ArrayCollection(); s.add(new person("Knud", "Mikkelsen", 35)); The problem is when I want to add people inside my jQuery function "mainFunction". I can't seem to get it right. I know it's something to do with scope and I have to wrap something in functions like in my ArrayCollection. Please help me - thanks a lot. function ArrayCollection() { var myArray = new Array; return { empty: function () { myArray.splice(0, myArray.length); }, add: function (myElement) { myArray.push(myElement); }, getAll: function () { return myArray; } } } function person(firstName, lastName, age) { this.firstName = firstName; this.lastName = lastName; this.age = parseInt(parseFloat(age)); } function mainFunction() { //.... var s = new ArrayCollection(); s.add(new person("Knud", "Mikkelsen", 35)); $.getJSON(url, function (data) { for (var x = 0; x < data.length; x++) { var myPerson = new person(data[x].FirstName.toString(), data[x].LastName.toString(), data[x].Age.toString()); s.add(myPerson); } }); alert(drawArray(s.getAll())); } function drawArray(myArray) { var v = ""; for (var i = 0; i < myArray.length; i++) { v += myArray[i].firstName + " " + myArray[i].lastName + " (" + myArray[i].age + ")\n"; } return v; }

    Read the article

  • DataGrid Column names don't seem to be binding

    - by Jason
    Sort of a Flex newbie here so bear with me. I've got a DataGrid defined as follows: <mx:Script> ... private function getColumns(names:ArrayCollection):Array { var ret:Array = new Array(); for each (var name:String in names) { var column:DataGridColumn = new DataGridColumn(name); ret.push(column); } return ret; } </mx:Script> <mx:DataGrid id="grid" width="100%" height="100%" paddingTop="0" columns="{getColumns(_dataSetLoader.columnNames)}" horizontalScrollPolicy="auto" labelFunction="labelFunction" dataProvider="{_dataSetLoader.data}" /> ...where _dataSetLoader is an instance of an object that looks like: [Bindable] public class DataSetLoader extends EventDispatcher { ... private var _data:ArrayCollection = new ArrayCollection(); private var _columnNames:ArrayCollection = new ArrayCollection(); ... public function reset():void { _status = NOTLOADED; _data.removeAll(); _columnNames.removeAll(); } ... When reset() is called on the dataSetLoader instance, the DataGrid empties the data in the cells, as expected, but leaves the column names, even though reset() calls _columnNames.removeAll(). Shouldn't the change in the collection trigger a change in the DataGrid?

    Read the article

  • Labels aren't shown properly in combo box

    - by Vishal
    The below code show the labels from previously selected list any ideas? Steps to reproduce: Click on List AB Open the list but don't select / click any item Now click on List CD Open the list again and you see A, B as labels instead of C,D but if you click on any item then everything comes properly <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; public var ab:ArrayCollection=new ArrayCollection([{label: A, data: 1}, {label: B, data: 2}]); public var cd:ArrayCollection=new ArrayCollection([{label: C, data: 3}, {label: D, data: 4}]); private function abClick(event:Event):void { cb.dataProvider=ab; } private function cdClick(event:Event):void { cb.dataProvider=cd; } ]]> </mx:Script> <mx:Panel title="ComboBox Control Example" height="75%" width="75%" layout="horizontal" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> <mx:ComboBox id="cb" width="150"/> <mx:Button label="List AB" click="abClick(event);"/> <mx:Button label="List CD" click="cdClick(event);"/> </mx:Panel>

    Read the article

  • Flex Drag & Drop: Detecting when all data has been moved from source to destination

    - by Adam Tuttle
    I have two mx:TileList controls that I'm using to allow editing of objects in batch. The first contains a collection of all available data, and the 2nd contains the current batch. Both are bound to ArrayCollections, and using the native drag-n-drop functionality of the TileList control the data is moved from one ArrayCollection to the other when an object is dragged between them. I need to change the currentState to show & reset the batch manipulation controls when the batch count goes from 0 to n or n to 0 items. Based on the documentation, I would have thought that I should listen to the dragComplete event, but my testing shows that instead of firing after the data has been removed from the source ArrayCollection and added to the destination ArrayCollection, it fires (consistently) between these two actions. Both lists are similar to this: <mx:TileList id="srcList" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true" dataProvider="{images}" dragComplete="handleDragComplete(event)" allowMultipleSelection="true" /> And here's the source of the handleDragComplete function: private function handleDragComplete(e:DragEvent):void{ trace(e.dragInitiator.name + '.dragComplete: batch.length=' + batch.length.toString()); trace(e.dragInitiator.name + '.dragComplete: images.length=' + images.length.toString()); if (batch.length > 0){ currentState = 'show'; }else{ currentState = ''; } } And lastly, here's some example output from running the code. These are all run one after the other. Case 1: The application loads with 10 objects in the first list and the batch is empty. I dragged 1 object from the source list to the batch list. srcList.dragComplete: batch.length=1 srcList.dragComplete: images.length=10 (Expected: 1,9) Clearly, the object has been added to the batch ArrayCollection but not removed from the source. Case 2: Now, I'll drag a 2nd object into the batch. srcList.dragComplete: batch.length=2 srcList.dragComplete: images.length=9 (Expected: 2,8) Firstly, we can see that images.length has changed, showing that the object that I dragged from the source list to the batch list was removed AFTER the dragComplete event fired. The same thing happens this time: The new object is added to the batch ArrayCollection (batch.length=2), the dragComplete event fires (running these traces), and then the object is removed from the source ArrayCollection. Case 3: Now, I'll drag both images from the batch list back to their original location in the source list. batchList.dragComplete: batch.length=2 batchList.dragComplete: images.length=10 (Expected: 0,10) We can see that batch.length hasn't gone down, but the source images array is back at its original length of 10. QUESTION: Am I doing something wrong? Is there another event I could listen for? (Note: I tried both DragExit and DragDrop, just to be sure, and those behave as expected, but are not what I need.) Or is there another way to get the data that I want? Or... have I found a bug in the SDK?

    Read the article

  • Problem to cretate dynamic radio button in flex.

    - by nemade-vipin
    hi friends, I am creating the flex ARI application in which I am accessing the webservice method this method is returning me a childList.I am accessing it in my flex appliction using the Array object in my action script code.Now I want to cretate one flex page in which I get child list with radio button.I have done it using Arraycollection in which i put all the child name.Now I am getting each child name in mxml using the Repeater component in mxml.But I have problem is that I am getting the only list of child name.I also want to get child id for to set value for each radio button. how can I refer same childname and it's id for radio button using same Arraycollection list.my code is import mx.controls.*; [Bindable] private var childName:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; [Bindable] private var childObj:Child; public var user:SBTSWebService; public function initApp():void { user = new SBTSWebService(); user.addSBTSWebServiceFaultEventListener(handleFaults); } public function displayString():void { // Instantiate a new Entry object. var newEntry:GetSBTSMobileAuthentication = new GetSBTSMobileAuthentication(); newEntry.mobile=mobileno.text; newEntry.password=password.text; user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); user.getSBTSMobileAuthentication(newEntry); } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null) { if(event.result._return > 0) { var UserId:int = event.result._return; getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } public function getChildList(userId:int):void { var childEntry:GetSBTSMobileChildrenInfo = new GetSBTSMobileChildrenInfo(); childEntry.UserId = userId; user.addgetSBTSMobileChildrenInfoEventListener(sbtsChildrenInfoResult); user.getSBTSMobileChildrenInfo(childEntry); } public function sbtsChildrenInfoResult(event:GetSBTSMobileChildrenInfoResultEvent):void { if(event.result != null && event.result._return!=null) { arrayOfchild = event.result._return as Array; photoFeed = new ArrayCollection(arrayOfchild); childName = new ArrayCollection(); for( var count:int=0;count<photoFeed.length;count++) { childObj = photoFeed.getItemAt(count,0) as Child; childName.addItem(childObj.strName); } } } ]]> <mx:Panel width="500" height="300" headerColors="[#000000,#FFFFFF]"> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form"> <mx:FormItem label="Mobile NO:"> <mx:TextInput id="mobileno" /> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="displayString()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> <mx:RadioButtonGroup id="radioGroup" /> <mx:Repeater id="fieldRepeater" dataProvider="{childName}"> <mx:RadioButton groupName="radioGroup" label="{fieldRepeater.currentItem}"/> </mx:Repeater> </mx:Form> <mx:Form label="Child Information"> </mx:Form> <mx:Form label="Trace Path"> </mx:Form> </mx:TabNavigator> </mx:Panel> please tell me the sol.

    Read the article

  • Flex Spark DropDownList selectedItem didn't update after dataProvider changed

    - by Candy Chiu
    I have two dataProvider's for one DropDownList. The following code can be compiled and run. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="flipLast()" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; public function flipLast():void { if( last ) { list.dataProvider = dp1; list.selectedItem = "Flex"; } else { list.dataProvider = dp2; list.selectedItem = "Catalyst"; } last = !last; } public var last:Boolean = true; public var dp1:ArrayCollection = new ArrayCollection( [ "Flex", "Air" ] ); public var dp2:ArrayCollection = new ArrayCollection( [ "Catalyst", "FlashBuilder" ] ); ]]> </fx:Script> <s:VGroup> <s:DropDownList id="list" requireSelection="true" /> <s:Label id="listSelectedItem" text="{list.selectedItem}" /> <s:Label id="listSelectedIndex" text="{list.selectedIndex}" /> <s:Button label="Flip" click="flipLast()" /> </s:VGroup> </s:Application> Scenario 1: dataProvider updated, but selectedIndex is the same. At startup: [ listSelectedItem=Flex, listSelectedIndex=1 ]. Click Flip: dataProvider is updated, but still [ listSelectedItem=Flex, listSelectedIndex=1 ]. Scenario 2: dataProvider updated, selectedIndex is also updated. At startup: [ listSelectedItem=Flex, listSelectedIndex=1 ]. Select Air from list: [ listSelectedItem=Air, listSelectedIndex=2 ]. Click Flip: dataProvider is updated, but still [ listSelectedItem=Catalyst, listSelectedIndex=1 ]. Seems to me that selectedItem is driven by selectedIndex. selectedItem updates only when selectedIndex updates. Shouldn't selectedItem be updated when dataProvider is updated? Is binding to selectedItem flawed?

    Read the article

  • combobox dataprovider

    - by FALCONSEYE
    I have the following: <mx:RemoteObject id="myCFC" destination="ColdFusion" source="components.myCFC" showBusyCursor="true"> <mx:method name="getStuff" result="UserHandler(event);"/> </mx:RemoteObject> ... <mx:ComboBox id="propertyCode" dataProvider="{qry_stuff}" labelField="name" /> Index.as has: [Bindable] public var qry_stuff:ArrayCollection = new ArrayCollection; private function UserHandler(event:ResultEvent):void { qry_stuff= event.result as ArrayCollection; } public function init():void { /* call my remote Object to get my data */ myCFC.getStuff(); } my problem is the combobox displays [object Object] I know there is nothing wrong with the cfc and there is a field called "name" in getStuff. Why does it not display the value of the object? thanks in advance.

    Read the article

  • Changing the width of dropdown area in flex combobox.

    - by DineshDu
    I have a combobox which gets populated by a remote method. I need to set the dropdownwidth of the combobox to the maximum length of the item in the combobox. I am able to achieve it by the following code. But if the resolution of the screen changes, the result is not similar. Is there any way to find the display width of the text in the dropdown? private function getGroupData(resultEvent:ResultEvent):void{ viewCbx.dataProvider = resultEvent.result as ArrayCollection; var comboDp:ArrayCollection = viewCbx.dataProvider as ArrayCollection; var dropWidth:int = 0; for each(var obj:Object in comboDp){ if(obj.groupName.length > dropWidth){ dropWidth = obj.groupName.length; } } viewCbx.dropdownWidth = dropWidth*6; }

    Read the article

  • What's the best way to use hamcrest-AS3 to test for membership in an IList?

    - by Chris R
    I'm using Flex 3.3, with hamcrest-as3 used to test for item membership in a list as part of my unit tests: var myList: IList = new ArrayCollection(['a', 'b', 'c']).list; assertThat(myList, hasItems('a', 'b', 'c')); The problem is that apparently the IList class doesn't support for each iteration; for example, with the above list, this will not trace anything: for each (var i: * in myList) { trace (i); } However, tracing either an Array or an ArrayCollection containing the same data will work just fine. What I want to do is (without having to tear apart my existing IList-based interface) be able to treat an IList like an Array or an ArrayCollection for the purposes of testing, because that's what hamcrest does: override public function matches(collection:Object):Boolean { for each (var item:Object in collection) { if (_elementMatcher.matches(item)) { return true; } } return false; } Is this simply doomed to failure? As a side note, why would the IList interface not be amenable to iteration this way? That just seems wrong.

    Read the article

  • Getting error to access webservice.

    - by nemade-vipin
    hi friend, I have created webapplication in which I am getting the error:- ypeError: Error #1009: Cannot access a property or method of a null object reference. at FlexSBTSApp/displayString()[E:\Users\User1\Documents\Flex Builder 3\FlexSBTSApp\src\FlexSBTSApp.mxml:38] at FlexSBTSApp/___FlexSBTSApp_Button1_click()[E:\Users\User1\Documents\Flex Builder 3\FlexSBTSApp\src\FlexSBTSApp.mxml:118] my code is:- import mx.controls.*; [Bindable] private var childName:ArrayCollection; [Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; [Bindable] private var childObj:Child; public var user:SBTSWebService; public function initApp():void { user = new SBTSWebService(); user.addSBTSWebServiceFaultEventListener(handleFaults); } public function displayString():void { // Instantiate a new Entry object. var newEntry:GetSBTSMobileAuthentication = new GetSBTSMobileAuthentication(); newEntry.mobile=mobileno.text; newEntry.password=password.text; user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); user.getSBTSMobileAuthentication(newEntry); } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return>0) { if(event.result._return > 0) { var UserId:int = event.result._return; getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } public function getChildList(userId:int):void { var childEntry:GetSBTSMobileChildrenInfo = new GetSBTSMobileChildrenInfo(); childEntry.UserId = userId; user.addgetSBTSMobileChildrenInfoEventListener(sbtsChildrenInfoResult); user.getSBTSMobileChildrenInfo(childEntry); } public function sbtsChildrenInfoResult(event:GetSBTSMobileChildrenInfoResultEvent):void { if(event.result != null && event.result._return!=null) { arrayOfchild = event.result._return as Array; photoFeed = new ArrayCollection(arrayOfchild); childName = new ArrayCollection(); for( var count:int=0;count<photoFeed.length;count++) { childObj = photoFeed.getItemAt(count,0) as Child; childName.addItem(childObj.strName); } } } ]]> <mx:Panel width="500" height="300" headerColors="[#000000,#FFFFFF]"> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form"> <mx:FormItem label="Mobile NO:"> <mx:TextInput id="mobileno" /> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="displayString()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> <mx:RadioButtonGroup id="radioGroup"/> <mx:Repeater id="fieldRepeater" dataProvider="{childName}"> <mx:RadioButton groupName="radioGroup" label="{fieldRepeater.currentItem}" value="{fieldRepeater.currentItem}"/> </mx:Repeater> </mx:Form> <mx:Form label="Child Information"> </mx:Form> <mx:Form label="Trace Path"> </mx:Form> </mx:TabNavigator> </mx:Panel>

    Read the article

  • Getting TypeError: Error #1009: Cannot access a property or method of a null object reference.

    - by nemade-vipin
    hello friends, I have created small application for login in flex desktop application. In which I am refering webservice method for login for this have created the Authentication class. Now I want to refer different Textinput value for mobile no and Textinput value for password. In my Authentication class. for this I have created the object of mxml class.And using this I am getting the mobile no value and password value in My Action script class. This my code :- SBTS.mxml file xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" public function login():void { var User:Authentication; User = new Authentication(); User.authentication(); } ]] text=" Select Child."/ Action script class :- package src { import adobe.utils.XMLUI; import generated.webservices.*; import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.FaultEvent; public class Authentication { [ Bindable] private var childName:ArrayCollection; [ Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; public var user:SBTSWebService; public var mxmlobj:SBTS; public function authentication():void { user = new SBTSWebService(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { mxmlobj = new SBTS(); if(mxmlobj != null) { newEntry.mobile = mxmlobj.mobileno.text; // Getting error here error mention below newEntry.password= mxmlobj.password.text; } user.getSBTSMobileAuthentication(newEntry); } } } public function handleFaults(event:FaultEvent):void { Alert.show( "A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return0) { if(event.result._return 0) { var UserId:int = event.result._return; if(mxmlobj != null) { mxmlobj.loginform.enabled = false; mxmlobj.viewstack2.selectedIndex=1; } } else { Alert.show( "Authentication fail"); } } } } } I am getting this error :- TypeError: Error #1009: Cannot access a property or method of a null object reference. at SBTSBusineesObject::Authentication/authentication()[E:\Users\User1\Documents\Fl ex Builder 3\SBTS\src\SBTSBusineesObject\Authentication.as:35] at SBTS/login()[E:\Users\User1\Documents\Flex Builder 3\SBTS\src\SBTS.mxml:12] at SBTS/___SBTS_Button1_click()[E:\Users\User1\Documents\Flex Builder 3\SBTS\src\SBTS.mxml:27] please help me to remove this error.

    Read the article

  • invalidateList(); in flex3.0

    - by Ankur Sharma
    please tell me what invalidateList(); function does? i have one line of code, in which this function is getting called on arraycollection object like dg.invalidateList(); where dg is the id of datagrid, dataprovider for this dg is colors which is an arraycollection?? plzz tell me wht the invalidateList() function is doin? thanx

    Read the article

  • how to get mxml file in ActionScript class

    - by nemade-vipin
    hello friend I want to refer my mxml file into Actionscript class.My code is :- Mxml file is :- var User:Authentication; User = new Authentication(); User.authentication(); } ]] <mx:Panel width="100%" height="100%" layout="absolute"> <mx:TabNavigator width="100%" height="100%" id="viewstack2"> <mx:Form label="Login Form" id="loginform"> <mx:FormItem label="Mobile no:" creationPolicy="all"> <mx:TextInput id="mobileno"/> </mx:FormItem> <mx:FormItem label="Password:" creationPolicy="all"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="authentication()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> </mx:Form> </mx:TabNavigator> </mx:Panel> Action script class is package SBTSBusineesObject { import generated.webservices.*; import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.FaultEvent; public class Authentication { [Bindable] private var childName:ArrayCollection; [Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; public var user:SBTSWebService; public var mxmlobj:SBTS =null; public function authentication():void { user = new SBTSWebService(); mxmlobj = new SBTS(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { if(mxmlobj != null) { newEntry.mobile = mxmlobj.mobileno.text ; newEntry.password=mxmlobj.password.text; } user.getSBTSMobileAuthentication(newEntry); } } } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return>0) { if(event.result._return > 0) { var UserId:int = event.result._return; if(mxmlobj != null) { mxmlobj.loginform.enabled = false; mxmlobj.viewstack2.selectedIndex=1; } } else { Alert.show("Authentication fail"); } } } } }

    Read the article

  • Dynamic populate ComboBox (Flex)

    - by Vinzcent
    Hey, I want to populate a ComboBox after a clicked a button. This is my code: var dpNames:ArrayCollection = new ArrayCollection(); for each(var ca:Categorie in arrCategories) { dpNames.addItem ({label: ca.name, data: ca.value}); } cbWijzigCategorie.dataProvider = dpNames; But when he executes the last line, I alwas get the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. I have no idea why. Thanks a lot, Vincent

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >