Search Results

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

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

  • Flex DataGrid not Displaying Data

    - by asawilliams
    I have a custom dataGrid that acts more like a 2D list (if that makes sense at all). I am dynamically creating the columns and recreating the dataProvider to suit my needs. While debugging I can see that I am creating the columns and setting them to the dataGrid and creating and setting the dataProvider, but for some reason I am able to see the dataGrid and the columns but not the data. [Bindable] private var mockData:ArrayCollection = new ArrayCollection([ {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}]); ... <TwoDimensionalList width="100%" height="100%" numColumns="7" numRows="7" dataField="value" dataProvider="{mockData}"/> The snippet of code from the object only contains the important functions, everything else is not important (getters, setters, etc ...). While debugging I checked all the variables in the functions to make sure they were assigned and a value that I was expecting. [Snippet] public class TwoDimensionalList extends DataGrid { ... /** * Creates and sets properties of columns */ private function createColumns():void { var column:DataGridColumn; var cols:Array = this.columns; for(var i:uint=0; i < numColumns; i++) { column = new DataGridColumn("column"+i.toString()); column.dataField = "column"+i.toString(); cols[i]=column; } this.columns = cols; // go to the current gotoPage(this._currentPageNum); } /** * Sets the data for the dataprovider based on the * number of columns, rows, and page number. * * @param pageNum the page number of the data to be viewed in the DataGrids. */ private function gotoPage(pageNum:uint):void { _currentPageNum = pageNum; var startIndex:uint = (pageNum-1)*numColumns*numRows; var data:ArrayCollection = new ArrayCollection(); for(var i:uint=0; i < numRows; i++) { var obj:Object = new Object(); for(var j:uint=0; j < numColumns; j++) { if((i+(j*numRows)+startIndex) < _dataProvider.length) obj["column"+j.toString()] = String(_dataProvider.getItemAt(i+(j*numRows)+startIndex)["value"]); } data.addItem(obj); } this.dataProvider = data; } }

    Read the article

  • customizing item renderer

    - by BretzelPretzel
    i would like the label and message to be on the left of the icon....i would also like the icon to be right-aligned what is the best way to do this? I'm confused by some of the tutorials i'm seeing for custom item renderers since they never explain how to format the renderer mxml, so i haven't figured that out yet although i suspect that's what i need to be doing <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:components="components.*" creationComplete="imagelistings.send()" title="{data.title}"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.events.FlexEvent; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import spark.events.IndexChangeEvent; import valueObjects.imagelistingclass; [Bindable] private var listings:ArrayCollection = new ArrayCollection(); protected function toursService_resultHandler(event:ResultEvent):void { var listingarray:ArrayCollection=event.result.Chapter1.entry; var entry:imagelistingclass; for each(var plate:Object in listingarray) { entry=new imagelistingclass(); entry.image=plate.image; entry.location=plate.location; entry.html=plate.html; listings.addItem(entry); } } ]]> </fx:Script> <fx:Declarations> <s:HTTPService id="imagelistings" result="toursService_resultHandler(event)" url="assets/chapter1info.xml"/> </fx:Declarations> <s:List id="theList" left="0" right="0" top="0" bottom="0" alternatingItemColors="#000000" contentBackgroundColor="#404040" dataProvider="{listings}" horizontalScrollPolicy="off" > <s:itemRenderer> <fx:Component> <s:IconItemRenderer color="#FFFFFF" fontSize="30" iconField="location" labelField="" iconFillMode="scale" iconScaleMode="letterbox" iconHeight="125" messageField="image"> </s:IconItemRenderer> </fx:Component> </s:itemRenderer> </s:List>

    Read the article

  • AIR:- Desktop Application related to Window Component (Need some work around)

    - by Mahesh Parate
    Create custom component which contains Combobox and Datagrid. Application conations two button 1) Same Window and 2) New Window. (Label of two button) When you click on “Same Window” button your custom component should get added dynamically in your application. And when you click on “New Window” button your custom component should get open in different window (it should get shifted from application and should appear in Window component). Issue faced:- Clicking on Combobox, list is not getting open as change event doesn’t get fired in Native Window as it looses reference from main application. Issue with DataGrid in Native window (AIR). • DataGridEvent.COLUMN_STRETCH event get affected if try to open datagrid in Native Window. • DataGridEvent get fired but takes long time or even stuck while column stretch Note: Application is an Desktop Application. Only one instance is created in Application for your custom component to preserve current state on your custom component it can be Style, data, or other subcomponent state of your custom component (as above mentioned 2 component are just sample). Please find sample code below:- DataGridStretchIssue.mxml:- < ?xml version="1.0" encoding="utf-8"? < mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" width="800" height="500" < mx:Script < ![CDATA[ import mx.events.FlexEvent; import mx.core.Window; private var dgComp:DataGridComp = new DataGridComp(); private var win:Window; private function clickHandler(event:Event):void{ dgComp.percentWidth = 100; dgComp.percentHeight = 100; dgComp.x = 50; dgComp.y = 100; if(win){ win.close(); } this.addChild(dgComp); } private function openClickHandler(event:MouseEvent):void{ dgComp.x = 50; dgComp.y = 100; win = new Window();; win.width = 800; win.height = 500; win.addChild(dgComp); dgComp.percentWidth = 100; dgComp.percentHeight = 100; dgComp.x = 50; dgComp.y = 100; win.open(true) } ]]> < /mx:Script < mx:HBox <mx:Button id="btnID" click="clickHandler(event)" label="Same Window"/> <mx:Button id="btnIDOpen" click="openClickHandler(event)" label="New Window"/> < /mx:HBox < /mx:WindowedApplication DataGridComp.mxml < ?xml version="1.0" encoding="utf-8"? < mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" <mx:Script> <![CDATA[ import mx.events.DataGridEvent; import mx.collections.ArrayCollection; [Bindable] public var cards:ArrayCollection = new ArrayCollection( [ {label:"Visa", data:1}, {label:"MasterCard", data:2}, {label:"American Express", data:3} ]); private function stretchFn(event:DataGridEvent):void{ trace("--- Stretched---") } ]]> </mx:Script> <mx:HBox> <mx:ComboBox dataProvider="{cards}" width="150"/> <mx:DataGrid columnStretch="stretchFn(event)" > <mx:ArrayCollection> <mx:Object> <mx:Artist>Pavement</mx:Artist> <mx:Price>11.99</mx:Price> <mx:Album>Slanted and Enchanted</mx:Album> </mx:Object> <mx:Object> <mx:Artist>Pavement</mx:Artist> <mx:Album>Brighten the Corners</mx:Album> <mx:Price>11.99</mx:Price> </mx:Object> </mx:ArrayCollection> </mx:DataGrid> </mx:HBox> < /mx:Canvas Can any one suggest me some work around to make my code workable... :)

    Read the article

  • Problem to display 3D google map.

    - by nemade-vipin
    hello friends, I have implemented one Flex application in which I want to display 3D google map.In which I am getting the error the NUll object reference during map display. Here is my code:- import com.google.maps.controls.MapTypeControl; import adobe.utils.XMLUI; import mx.rpc.events.FaultEvent; import mx.controls.Alert; import generated.webservices.*; import mx.collections.ArrayCollection; import mx.controls.*; import generated.webservices.*; import com.google.maps.LatLng; import com.google.maps.Map3D; import com.google.maps.MapEvent; import com.google.maps.MapMouseEvent; import com.google.maps.services.GeocodingEvent; import com.google.maps.services.ClientGeocoder; import com.google.maps.overlays.Marker; import com.google.maps.InfoWindowOptions; import com.google.maps.MapOptions; import com.google.maps.MapType; import com.google.maps.View; import com.google.maps.controls.NavigationControl; import com.google.maps.geom.Attitude; import mx.controls.Alert; [Bindable] private var childName:ArrayCollection; [Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var trackinginfochild:TrackingInfo; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; private var trackinginfo:GetSBTSTrackingInfo; private var childObj:Child; private var UserId:int; private var lat:int; private var long:int; private var latlong:LatLng; public var user:SBTSWebService; public function authentication():void { // Instantiate a new Entry object. user = new SBTSWebService(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { newEntry.mobile=mobileno.text; newEntry.password=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) { UserId = event.result._return; loginform.enabled = false; 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._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); } } } private function trackingInfo():void { for( var count:int=0;count user.getSBTSTrackingInfo(trackinginfo); } } } } private function getTrackingInfo(event:GetSBTSTrackingInfoResultEvent):void { if(event.result._return != null) { trackinginfochild = event.result._return as TrackingInfo; lat = trackinginfochild.dblLatitude; long = trackinginfochild.dblLongitude; latlong = new LatLng(lat,long); } } private function onMapPreinitialize(event:MapEvent):void { var myMapOptions:MapOptions = new MapOptions(); myMapOptions.zoom = 12; myMapOptions.center = latlong; myMapOptions.mapType = MapType.NORMAL_MAP_TYPE; myMapOptions.viewMode = View.VIEWMODE_PERSPECTIVE; myMapOptions.attitude = new Attitude(20,30,0); buslocation.setInitOptions(myMapOptions); buspath.setInitOptions(myMapOptions); } private function onMapReady(event:MapEvent):void { this.buslocation.addControl(new NavigationControl()); this.buslocation.addControl( new MapTypeControl()); } ]]> <mx:Move id="hideEffect" yTo="-500" /> <mx:Move id="showEffect" xFrom="500"/> <mx:Panel width="100%" height="100%" headerColors="[#000000,#FFFFFF]" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form" id="loginform" hideEffect="{hideEffect}" showEffect="{showEffect}"> <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" id="childForm" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:Label width="100%" color="blue" text="Select Child."/> <mx:RadioButtonGroup id="radioGroup" itemClick="trackingInfo()"/> <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" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:FormItem> <mx:DataGrid id="childinfo"> <mx:columns> <mx:DataGridColumn headerText="Child Name" dataField="strName"/> <mx:DataGridColumn headerText="School Name" dataField="strSchoolName"/> <mx:DataGridColumn headerText="Pick Up Point" dataField="strPickUpPointName"/> <mx:DataGridColumn headerText="Drop Down Point" dataField="strDropDownPointName"/> </mx:columns> </mx:DataGrid> </mx:FormItem> <mx:FormItem> <mx:Button label="click here to see bus location"/> </mx:FormItem> </mx:Form> <mx:Form label="Bus Location" hideEffect="{hideEffect}" showEffect="{showEffect}"> <maps:Map3D xmlns:maps="com.google.maps.*" mapevent_mappreinitialize="onMapPreinitialize(event)" id="buslocation" width="100%" height="100%" url="http://code.google.com/apis/maps/" key="ABQIAAAAXuX6aG-r_N0-tQNxUEV-vRSE8al1BQssMxLXJiP75kIjR3ssLxT3D52_u94hI-dMIkD72FmnK-P4og"/> </mx:Form> <mx:Form label="Bus path" hideEffect="{hideEffect}" showEffect="{showEffect}"> <maps:Map3D xmlns:maps="com.google.maps.*" mapevent_mappreinitialize="onMapPreinitialize(event)" id="buspath" width="100%" height="100%" url="http://code.google.com/apis/maps/" key="ABQIAAAAXuX6aG-r_N0-tQNxUEV-vRSE8al1BQssMxLXJiP75kIjR3ssLxT3D52_u94hI-dMIkD72FmnK-P4og"/> </mx:Form> </mx:TabNavigator> </mx:Panel> I am getting this error :- TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.maps.geom::Geometry$/computeSeparatingAxes() at com.google.maps.geom::TileEnumerator/enumerateTiles() at com.google.maps.core::PerspectiveTilePane/computeOptimalSet() at com.google.maps.core::PerspectiveTilePane/render() at com.google.maps.core::PerspectiveTilePane/configure() at com.google.maps.managers::PerspectiveTileManager/updateView() at com.google.maps.managers::PerspectiveTileManager/initializePanes() at com.google.maps.managers::PerspectiveTileManager/onInitialize() at MethodInfo-190() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at com.google.maps.wrappers::BaseEventDispatcher/dispatchEvent() at com.google.maps.wrappers::EventDispatcherWrapper/dispatchEvent() at com.google.maps.core::MapImpl/size() at com.google.maps.core::MapImpl/setSize() at com.google.maps.wrappers::IMapWrapper/setSize() at com.google.maps::Map/internalSetSize() at com.google.maps::Map/onUIComponentResized() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at mx.core::UIComponent/dispatchResizeEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7077] at mx.core::UIComponent/setActualSize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6706] at mx.containers.utilityClasses::BoxLayout/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\utilityClasses\BoxLayout.as:219] at mx.containers::Form/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Form.as:375] at mx.core::UIComponent/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6351] at mx.core::Container/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2677] at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:695] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] Please resolve my issue.

    Read the article

  • Flex: Double click event propagation on datagrid dependent on component order?

    - by MyMacAndMe
    I'd like to have a double click event on a datagrid in Flex3. The following example only works if the Accordion (id = "mustBeSecond") container comes after the DataGrid. Why is the order of the components important and what can I do to prevent this behavior? (The example does not work. If you change the order of "mustBeSecond" and "gridReportConversions" the example works fine) <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; [Bindable] private var dp:ArrayCollection = new ArrayCollection([ {qty:1,referer:'http://google.com'}, {qty:25,referer:'http://cnn.com'}, {qty:4,referer:'http:stackoverflow.com'}]); private function refererRowDoubleClicked(e:Event):void { Alert.show("double click"); } ]]> </mx:Script> <mx:HBox width="100%" height="100%"> <mx:Accordion width="200" height="200" id="mustBeSecond"> <mx:Canvas label="Navigation Box" width="100%" height="100%"> <mx:VBox> <mx:LinkButton label="First Link" /> <mx:LinkButton label="Second Link" /> </mx:VBox> </mx:Canvas> </mx:Accordion> <mx:DataGrid id="gridReportConversions" height="100%" width="100%" dataProvider="{this.dp}" mouseEnabled="true" doubleClickEnabled="true" itemDoubleClick="refererRowDoubleClicked(event)"> <mx:columns> <mx:DataGridColumn width="75" dataField="qty" headerText="Qty" /> <mx:DataGridColumn dataField="referer" headerText="URL" /> </mx:columns> </mx:DataGrid> </mx:HBox>

    Read the article

  • Flex List ItemRenderer with image looses BitmapData when scrolling

    - by Dominik
    Hi i have a mx:List with a DataProvider. This data Provider is a ArrayCollection if FotoItems public class FotoItem extends EventDispatcher { [Bindable] public var data:Bitmap; [Bindable] public var id:int; [Bindable] public var duration:Number; public function FotoItem(data:Bitmap, id:int, duration:Number, target:IEventDispatcher=null) { super(target); this.data = data; this.id = id; this.duration = duration; } } my itemRenderer looks like this: <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" > <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; ]]> </fx:Script> <s:Label text="index"/> <mx:Image source="{data.data}" maxHeight="100" maxWidth="100"/> <s:Label text="Duration: {data.duration}ms"/> <s:Label text="ID: {data.id}"/> </mx:VBox> Now when i am scrolling then all images that leave the screen disappear :( When i take a look at the arrayCollection every item's BitmapData is null. Why is this the case?

    Read the article

  • How do I ensure a Flex dataProvider processes the data synchronously?

    - by Matt Calthrop
    I am using an component, and currently have a dataProvider working that is an ArrayCollection (have a separate question about how to make this an XML file... but I digress). Variable declaration looks like this: [Bindable] private var _dpImageList : ArrayCollection = new ArrayCollection([ {"location" : "path/to/image1.jpg"}, {"location" : "path/to/image2.jpg"}, {"location" : "path/to/image3.jpg"} ]); I then refer to like this: <s:List id="lstImages" width="100%" dataProvider="{_dpImageList}" itemRenderer="path.to.render.ImageRenderer" skinClass="path.to.skins.ListSkin" > <s:layout> <s:HorizontalLayout gap="2" /> </s:layout> </s:List> Currently, it would appear that each item is processed asynchronously. However, I want them to be processed synchronously. Reason: I am displaying a list of images, and I want the leftmost one rendered first, followed by the one to its right, and so on. Edit: I just found this answer. Do you think that could be the same issue?

    Read the article

  • Not Understanding Basics Of Dynamic DataBinding (bindPropety) In Flex

    - by Joshua
    I need to dynamically bind properties of components created at runtime. In this particular case please assume I need to use bindProperty. I don't quite understand why the following simplistic test is failing (see code). When I click the button, the label text does not change. I realize that there are simpler ways to go about this particular example using traditional non-dynamic binding, but I need to understand it in terms of using bindProperty. Can someone please help me understand what I'm missing? <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" xmlns:ns2="*" creationComplete="Init();"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.binding.utils.*; public var Available:ArrayCollection=new ArrayCollection(); public function get Value():String { return (Available.getItemAt(0).toString()); } public function Init():void { Available.addItemAt('Before', 0); BindingUtils.bindProperty(Lab, 'text', this, 'Value'); } public function Test():void { Available.setItemAt('After', 0); } ]]> </mx:Script> <mx:Label x="142" y="51" id="Lab"/> <mx:Button x="142" y="157" label="Button" click="Test();"/> </mx:WindowedApplication> Thanks in advance.

    Read the article

  • Length of a string in pixels

    - by Rose
    Guys, I'm populating a dropDownList with arrayCollection of strings. I want the width of the drop down list control to match with the size (in pixels) of the longest string in the array collection. The problem I'm facing is: the font width of the strings in the collection are different e.g. 'W' looks wider than 'l'. So I estimated the width of a character to be 8 pixels but that's not pretty neat. If a string that has many 'W' and 'M' is encountered the estimation is wrong. So I want precise pixel width of strings. How can i get the exact length of a string in pixels?? My solution that estimates all character to be 8 pixels wide is given below: public function populateDropDownList():void{ var array:Array = new Array("o","two","three four five six seven eight wwww"); var sampleArrayCollection:ArrayCollection = new ArrayCollection(array); var customDropDownList:DropDownList = new DropDownList(); customDropDownList.dataProvider=sampleArrayCollection; customDropDownList.prompt="Select ..."; customDropDownList.labelField="Answer Options:"; //calculating the max width var componentWidth=10; //default for each(var answerText in array){ Alert.show("Txt size: "+ answerText.length + " pixels: " + answerText.length*9); if(answerText.length * 8 > componentWidth){ componentWidth=answerText.length * 8; } } customDropDownList.width=componentWidth; answers.addChild(customDropDownList); } Any idea or solution is highly valued. Thanks

    Read the article

  • Flex chart not displaying right values along x axis.

    - by Shah Al
    I don't know of any better way to ask this question. If the below code is run (i know the cData sections are not visible in the preview, something causes it to be ignored). The result does not represent the data correctly. 1. Flex ignores missing date 24 aug for DECKER. 2. It wrongly associates 42.77 to 23-Aug instead of 24-AUG. Is there a way in flex, where the x-axis is a union of all available points ? The below code is entirely from : Adobe website link I have only commented 2 data points. //{date:"23-Aug-05", close:45.74}, and //{date:"24-Aug-05", close:150.71}, <?xml version="1.0"?> [Bindable] public var SMITH:ArrayCollection = new ArrayCollection([ {date:"22-Aug-05", close:41.87}, //{date:"23-Aug-05", close:45.74}, {date:"24-Aug-05", close:42.77}, {date:"25-Aug-05", close:48.06}, ]); [Bindable] public var DECKER:ArrayCollection = new ArrayCollection([ {date:"22-Aug-05", close:157.59}, {date:"23-Aug-05", close:160.3}, //{date:"24-Aug-05", close:150.71}, {date:"25-Aug-05", close:156.88}, ]); [Bindable] public var deckerColor:Number = 0x224488; [Bindable] public var smithColor:Number = 0x884422; ]] <mx:horizontalAxisRenderers> <mx:AxisRenderer placement="bottom" axis="{h1}"/> </mx:horizontalAxisRenderers> <mx:verticalAxisRenderers> <mx:AxisRenderer placement="left" axis="{v1}"> <mx:axisStroke>{h1Stroke}</mx:axisStroke> </mx:AxisRenderer> <mx:AxisRenderer placement="left" axis="{v2}"> <mx:axisStroke>{h2Stroke}</mx:axisStroke> </mx:AxisRenderer> </mx:verticalAxisRenderers> <mx:series> <mx:ColumnSeries id="cs1" horizontalAxis="{h1}" dataProvider="{SMITH}" yField="close" displayName="SMITH" > <mx:fill> <mx:SolidColor color="{smithColor}"/> </mx:fill> <mx:verticalAxis> <mx:LinearAxis id="v1" minimum="40" maximum="50"/> </mx:verticalAxis> </mx:ColumnSeries> <mx:LineSeries id="cs2" horizontalAxis="{h1}" dataProvider="{DECKER}" yField="close" displayName="DECKER" > <mx:verticalAxis> <mx:LinearAxis id="v2" minimum="150" maximum="170"/> </mx:verticalAxis> <mx:lineStroke> <mx:Stroke color="{deckerColor}" weight="4" alpha="1" /> </mx:lineStroke> </mx:LineSeries> </mx:series> </mx:ColumnChart> <mx:Legend dataProvider="{myChart}"/>

    Read the article

  • problem to genrate swf file.

    - by nemade-vipin
    hello friend I have created one flex Air application where I have created the one authentication actionscript class. and one mxml file.This complete application using webservice and google map API. but when I am building application it is not genrating the SWF file in bin-debug folder. that is changes not reflecting in our application. my code is:- Action script class is :- package src { import adobe.utils.XMLUI; import mx.rpc.events.FaultEvent; import mx.controls.Alert; import generated.webservices.*; import mx.collections.ArrayCollection; 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 function authentication():void { // Instantiate a new Entry object. user = new SBTSWebService(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { newEntry.mobile=mobileno.text; newEntry.password=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; loginform.enabled = false; //getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } } } mxml file is :- import src.Authentication; var user:Authentication = new Authentication(); ]]> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form" id="loginform"> <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="user.authentication()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> </mx:Form> <mx:Form label="Child Information"> </mx:Form> <mx:Form label="Bus Location"> </mx:Form> <mx:Form label="Bus path"> </mx:Form> </mx:TabNavigator> </mx:Panel>

    Read the article

  • What is the recommended way of parsing an XML feed with multiple namespaces with ActionScript 3.0?

    - by dafko
    I have seen the following methods to be used in several online examples, but haven't found any documentation on the recommended way of parsing an XML feed. Method 1: protected function xmlResponseHandler(event:ResultEvent):void { var atom:Namespace = new Namespace("http://www.w3.org/2005/Atom"); var microsoftData:Namespace = new Namespace("http://schemas.microsoft.com/ado/2007/08/dataservices"); var microsoftMetadata:Namespace = new Namespace("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); var ac:ArrayCollection = new ArrayCollection(); var keyValuePairs:KeyValuePair; var propertyList:XMLList = (event.result as XML)..atom::entry.atom::content.microsoftMetadata::properties; for each (var properties:XML in propertyList) { keyValuePairs = new KeyValuePair(properties.microsoftData::FieldLocation, properties.microsoftData::Locationid); ac.addItem(keyValuePairs); } cb.dataProvider = ac; } Method 2: protected function xmlResponseHandler(event:ResultEvent):void { namespace atom = "http://www.w3.org/2005/Atom"; namespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices"; namespace m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; use namespace d; use namespace m; use namespace atom; var ac:ArrayCollection = new ArrayCollection(); var keyValuePairs:KeyValuePair; var propertyList:XMLList = (event.result as XML)..entry.content.properties; for each (var properties:XML in propertyList) { keyValuePairs = new KeyValuePair(properties.FieldLocation, properties.Locationid); ac.addItem(keyValuePairs); } cb.dataProvider = ac; } Sample XML feed: <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <feed xml:base="http://www.test.com/Test/my.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> <title type="text">Test_Locations</title> <id>http://www.test.com/test/my.svc/Test_Locations</id> <updated>2010-04-27T20:41:23Z</updated> <link rel="self" title="Test_Locations" href="Test_Locations" /> <entry> <id>1</id> <title type="text"></title> <updated>2010-04-27T20:41:23Z</updated> <author> <name /> </author> <link rel="edit" title="Test_Locations" href="http://www.test.com/id=1" /> <category term="MySQLModel.Test_Locations" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:FieldLocation>Test Location</d:FieldLocation> <d:Locationid>test0129</d:Locationid> </m:properties> </content> </entry> <entry> <id>2</id> <title type="text"></title> <updated>2010-04-27T20:41:23Z</updated> <author> <name /> </author> <link rel="edit" title="Test_Locations" href="http://www.test.com/id=2" /> <category term="MySQLModel.Test_Locations" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:FieldLocation>Yet Another Test Location</d:FieldLocation> <d:Locationid>test25</d:Locationid> </m:properties> </content> </entry> </feed>

    Read the article

  • flex 3 using nested repeaters

    - by ccdugga
    I'm trying to loop through a row of an arraycollection using nested repeater; <mx:Repeater id="rp1" dataProvider="{arrayCollection}"> <mx:Repeater id="rp2" dataProvider="{rp1.currentItem}"> <mx:Button height="49" width="50" label="{rp2.currentItem.name}" /> </mx:Repeater> </mx:Repeater> What im trying to do is make the repeater loop through all the attributes in the currentRow, eg. name,age, address etc. At the moment all i do is call rp2.currentItem.name which explicitly calls out the name of the attribute and then the value is returned. Is it possible instead of explicity naming the attribute to just loop through them all and dispplay button for each using the nested repeater?thanks

    Read the article

  • Having trouble with binding

    - by Tam
    I'm not sure if I'm misunderstanding the binding in Flex. I'm using Cairngorm framework. I have the following component with code like: [Bindable] var _model:LalModelLocator = LalModelLocator.getInstance(); .... <s:DataGroup dataProvider="{_model.friendsSearchResults}" includeIn="find" itemRenderer="com.lal.renderers.SingleFriendDisplayRenderer"> <s:layout> <s:TileLayout orientation="columns" requestedColumnCount="2" /> </s:layout> </s:DataGroup> in the model locator: [Bindable] public var friendsSearchResults:ArrayCollection = new ArrayCollection(); Inside the item renderer there is a button that calls a command and inside the command results there is a line like this: model.friendsSearchResults = friendsSearchResults; Putting break points and stepping through the code I confirmed that this like gets called and the friendsSearchResults gets updated. To my understanding if I update a bindable variable it should automatically re-render the s:DataGroup which has a dataProvider of that variable.

    Read the article

  • Flex+JPA/Hibernate+BlazeDS+MySQL how to debug this monster?!

    - by Zenzen
    Ok so I'm making a "simple" web app using the technologies from the topic, recently I found http://www.adobe.com/devnet/flex/articles/flex_hibernate.html so I'm following it and I try to apply it to my app, the only difference being I'm working on a Mac and I'm using MAMP for the database (so no command line for me). The thing is I'm having some trouble with retrieving/connecting to the database. I have the remoting-config.xml, persistance.xml, a News.java class (my Entity), a NewsService.java class, a News.as class - all just like in the tutorial. I have of course this line in one of my .mxmls: <mx:RemoteObject id="loaderService" destination="newsService" result="handleLoadResult(event)" fault="handleFault(event)" showBusyCursor="true" /> And my remoting-config.xml looks like this (well part of it): <destination id="newsService"> <properties><source>com.gamelist.news.NewsService</source></properties> </destination> NewsService has a method: public List<News> getLatestNews() { EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT); EntityManager em = emf.createEntityManager(); Query findLatestQuery = em.createNamedQuery("news.findLatest"); List<News> news = findLatestQuery.getResultList(); return news; } And the named query is in the News class: @Entity @Table(name="GLT_NEWS") @NamedQueries({ @NamedQuery(name="news.findLatest", query="from GLT_NEWS order by new_date_added limit 5 ") }) The handledLoadResult looks like this: private function handleLoadResult(ev:ResultEvent):void { newsList = ev.result as ArrayCollection; newsRecords = newsList.length; } Where: [Bindable] private var newsList:ArrayCollection = new ArrayCollection(); But when I try to trigger: loaderService.getLatestNews(); nothing happens, newsList is empty. Few things I need to point out: 1) as I said I didn't install mysql manually, but I'm using MAMP (yes, the server's running), could this cause some trouble? 2) I already have a "gladm" database and I have a "GLT_NEWS" table with all the fields, is this bad? Basically the question is how am I suppose to debug this thing so I can find the mistake I'm making? I know that loadData() is executed (did a trace()), but I have no idea what happens with loaderService.getLatestNews()... @EDIT: ok so I see I'm getting an error in the "fault handler" which says "Error: Client.Error.MessageSend - Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf' - "

    Read the article

  • Graph Generation in flex

    - by Roshan
    I need to generate a graph using the following XML in FLEX. [Bindable] public var stockDataAC:ArrayCollection = new ArrayCollection( [ {date: "2010, 4, 27", close: 41.71}, {date: "2010, 4, 28", close: 42.21}, {date: "2010, 5, 2", close: 42.71}, {date: "2010, 5, 3", close: 42.99}, {date: "2010, 5, 4", close: 44} ]); .............. < mx:horizontalAxis < mx:DateTimeAxis dataUnits="days" displayLocalTime="true" parseFunction="myParseFunction" / < /mx:horizontalAxis But this displays the graph from 2010/4/27 till 2010/5/4 including 2010/4/29, 2010/4/30 and 2010/5/1. I require the graph to display only the points in XML and exclude remaining thought it lies in between since it contains no data. How this can be done?

    Read the article

  • Using summary data from dataprovider to populate chart.

    - by arunp
    In Flex, how do i create a summary(say total of various domains) from the data provider and display in chart? Say this is my dataprovider.. I want to display the total estimate of each territory as a slice in piechart private var dpFlat:ArrayCollection = new ArrayCollection([ {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, {Region:"Southwest", Territory:"Central California", Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, {Region:"Southwest", Territory:"Nevada", Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000} ]);

    Read the article

  • DateTimeAxis - set Label to display Date + Time

    - by Jay
    Hi, Is there a way in flex 3 chart component to display both the date and time using horizontal DateTimeAxis? Currently the DateTimeAxis element has an attribute dataunits which allows to set the value to any of "milliseconds|seconds|minutes|hours|days|weeks|months|years" but I want to display the label as "2009/09/15 06:00:00" which includes the day and the time too. Here is the sample that i'm using [Bindable] public var deck:ArrayCollection = new ArrayCollection([ {date:"2009-09-15 06:00:00", close:42.71}, {date:"2009-09-16 06:15:00", close:42.99} ]); public function myParseFunction(s:String):Date { var sDate = s.substring(0,s.indexOf(" ")); var sTime = s.substring(s.indexOf(" ")); var aDate = sDate.split("-"); var aTime = sTime.split(":"); return new Date(aDate[0],(aDate[1]*1-1),aDate[2],aTime[0],aTime[1],aTime[2],0); } ]] Thanks in advance.

    Read the article

  • Flex bug?? Get messed up stacked ColumnChart with type="100%"

    - by Nir
    I am trying to do a stacked Column chart with type="100%" and a mixture of positive and negative values. When all the values are positive, is functions well, but when negative numbers come to the game, it looks totally messed up. When I also look at Adobe documentation (look here), I see the following code for stacked column chart involving negative numbers: <?xml version="1.0"?> <!-- charts/StackedNegative.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script><![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var expenses:ArrayCollection = new ArrayCollection([ {Month:"Jan", Profit:-2000, Expenses:-1500}, {Month:"Feb", Profit:1000, Expenses:-200}, {Month:"Mar", Profit:1500, Expenses:-500} ]); ]]></mx:Script> <mx:Panel title="Column Chart"> <mx:ColumnChart id="myChart" dataProvider="{expenses}" showDataTips="true"> <mx:horizontalAxis> <mx:CategoryAxis dataProvider="{expenses}" categoryField="Month" /> </mx:horizontalAxis> <mx:series> <mx:ColumnSet type="stacked" allowNegativeForStacked="true"> <mx:series> <mx:ColumnSeries xField="Month" yField="Profit" displayName="Profit" /> <mx:ColumnSeries xField="Month" yField="Expenses" displayName="Expenses" /> </mx:series> </mx:ColumnSet> </mx:series> </mx:ColumnChart> <mx:Legend dataProvider="{myChart}"/> </mx:Panel> </mx:Application> It works fine. But try to change: <mx:ColumnSet type="stacked" allowNegativeForStacked="true"> to: <mx:ColumnSet type="100%" allowNegativeForStacked="true"> and you'll see that it doesn't on January data, where both values are negative, the chart shows as if they are positive, and on the other two where one value is positive and the other is negative, it shows only the positive part as 100%... Isn't it a Flex Bug? I have my own case with such data and it behaves wrong the same way. I'd expect that if it has 800 stacked on -200, it will show 80% up and 20% down, totalling 100%. BTW: Using Flex 4, though these are all mx components. Thanks a lot and regards from Berlin, Germany, Nir.

    Read the article

  • Replace Infinite loop in Flex

    - by H P
    Hello, I want to access a webservice:getMonitorData() , on creationcomplete and returns an array, in an infinite loop so that the getIndex0.text is updated each time. Flex is not able to handle an infinite loop and gives a timeout error 1502. If I run the for loop until i<2000 or so it works fine. How can replace the loop so that my webservice is accessed continiously and the result is shown in getIndex0.text. This is how my application looks like: <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300" xmlns:plcservicebean="server.services.plcservicebean.*" creationComplete="clientMonitor1()"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.CallResponder; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; [Bindable] public var dbl0:Number; //-----------Infinite Loop, Works fine if condition = i<2000------------------------ public function clientMonitor1():void{ for(var i:int = 0; ; i++){ clientMonitor(); } } public function clientMonitor():void{ var callResp:CallResponder = new CallResponder(); callResp.addEventListener(ResultEvent.RESULT, monitorResult); callResp.addEventListener(FaultEvent.FAULT, monitorFault); callResp.token = plcServiceBean.getMonitorData(); } public function monitorResult(event:ResultEvent):void{ var arr:ArrayCollection = event.result as ArrayCollection; dbl0 = arr[0].value as Number; } protected function monitorFault(event:FaultEvent):void{ Alert.show(event.fault.faultString, "Error while monitoring Data "); } ]]> </fx:Script> <fx:Declarations> <plcservicebean:PlcServiceBean id = "plcServiceBean" showBusyCursor="true" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" /> </fx:Declarations> <mx:Form x="52" y="97" label="Double"> <mx:FormItem label = "getMonitorValue"> <s:TextInput id = "getIndex0" text = "{dbl0}"/> </mx:FormItem> </mx:Form> </s:Group>

    Read the article

  • CheckBox header renderer with HierarchicalCollectionView

    - by fumeng
    Hi - I've gotten a checkbox header renderer to work well with flat DPs, but a hierarchical collection view is another story. On click, I want it to select all checkboxes in a given column. Here is my code: var dp:HierarchicalCollectionView = _dataGrid.dataProvider as HierarchicalCollectionView; var testDp:GroupingCollection = dp.source as GroupingCollection; var rawDp:ArrayCollection = testDp.source as ArrayCollection; for(var i:int=0 ; i < rawDp.length ; i++){ rawDp[i][_dataField] = cb.selected; } It selects all checkboxes on the 2nd level of data, but doesn't select the top level of data. What am I missing here? I can't seem to find it. Any tips are greatly appreciated. Thank you.

    Read the article

  • Can't use static const as param in function call within binding tags in Flex 3

    - by buzzer
    I'm having a problem in flex 3 where if a static const I have defined is used as the parameter to a function call within binding tags I get a "1120: Access of undefined property NodePropertyMatrix". _propMtx is a ArrayCollection. <mx:HBox visible="{_propMtx.getItemAt(NodePropertyMatrix.srcParent)}"> Above code throws the error, but the following code does not <mx:HBox visible="{NodePropertyMatrix.srcParent}"> NodePropertyMatrix is an AS class as follows: package model.constants { import mx.collections.ArrayCollection; public class NodePropertyMatrix { public static const srcParent:Number = 0; } } Anyone know what is wrong here?

    Read the article

  • Flex 4, chart, Error 1009

    - by Stephane
    Hello, I am new to flex development and I am stuck with this error TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.charts.series::LineSeries/findDataPoints()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\series\LineSeries.as:1460] at mx.charts.chartClasses::ChartBase/findDataPoints()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\ChartBase.as:2202] at mx.charts.chartClasses::ChartBase/mouseMoveHandler()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\ChartBase.as:4882] I try to create a chart where I can move the points with the mouse I notice that the error doesn't occur if I move the point very slowly I have try to use the debugger and pint some debug every where without success All the behaviours were ok until I had the modifyData Please let me know if you have some experience with this kind of error I will appreciate any help. Is it also possible to remove the error throwing because after that the error occur if I click the dismiss all error button then the component work great there is the simple code of the chart <fx:Declarations> </fx:Declarations> <fx:Script> <![CDATA[ import mx.charts.HitData; import mx.charts.events.ChartEvent; import mx.charts.events.ChartItemEvent; import mx.collections.ArrayCollection; [Bindable] private var selectItem:Object; [Bindable] private var chartMouseY:int; [Bindable] private var hitData:Boolean=false; [Bindable] private var profitPeriods:ArrayCollection = new ArrayCollection( [ { period: "Qtr1 2006", profit: 32 }, { period: "Qtr2 2006", profit: 47 }, { period: "Qtr3 2006", profit: 62 }, { period: "Qtr4 2006", profit: 35 }, { period: "Qtr1 2007", profit: 25 }, { period: "Qtr2 2007", profit: 55 } ]); public function chartMouseUp(e:MouseEvent):void{ if(hitData){ hitData = false; } } private function chartMouseMove(e:MouseEvent):void { if(hitData){ var p:Point = new Point(linechart.mouseX,linechart.mouseY); var d:Array = linechart.localToData(p); chartMouseY=d[1]; modifyData(); } } public function modifyData():void { var idx:int = profitPeriods.getItemIndex(selectItem); var item:Object = profitPeriods.getItemAt(idx); item.profit = chartMouseY; profitPeriods.setItemAt(item,idx); } public function chartMouseDown(e:MouseEvent):void{ if(!hitData){ var hda:Array = linechart.findDataPoints(e.currentTarget.mouseX, e.currentTarget.mouseY); if (hda[0]) { selectItem = hda[0].item; hitData = true; } } } ]]> </fx:Script> <s:layout> <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle" /> </s:layout> <s:Panel title="LineChart Control" > <s:VGroup > <s:HGroup> <mx:LineChart id="linechart" color="0x323232" height="500" width="377" mouseDown="chartMouseDown(event)" mouseMove="chartMouseMove(event)" mouseUp="chartMouseUp(event)" showDataTips="true" dataProvider="{profitPeriods}" > <mx:horizontalAxis> <mx:CategoryAxis categoryField="period"/> </mx:horizontalAxis> <mx:series> <mx:LineSeries yField="profit" form="segment" displayName="Profit"/> </mx:series> </mx:LineChart> <mx:Legend dataProvider="{linechart}" color="0x323232"/> </s:HGroup> <mx:Form> <mx:TextArea id="DEBUG" height="200" width="300"/> </mx:Form> </s:VGroup> </s:Panel> UPDATE 30/2010 : the null object is _renderData.filteredCache from the chartline the code call before error is the default mouseMoveHandler of chartBase to chartline. Is it possible to remove it ? or provide a filteredCache

    Read the article

  • How do I stop a datagrid's first-row itemRenderer from instantiating/adding/initializing/etc twice?

    - by Michael Prescott
    In a Flex DataGrid's first row, the itemRenderer will initialize twice. Tracing the results reveals that the flex framework is possibly creating two instances of the first row's itemRenderer. In a more complex application, where the itemRenderer contains a data-bound ColorPicker, we're seeing an infinite loop occur because of this problem. Only the first row's itemRenderer is initialized twice. Is there a way to override flex's behavior and stop this from occurring? The following code demonstrates the problem: Main Application: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="on_initialize(event);"> <mx:Script> <![CDATA[ /** * This experiment shows how the first row's itemrenderer is instantiated/added/initialized twice. * We've never even noticed this before we found that a data-bound ColorPicker enters a infinite * loop when it is within an itemRenderer. */ import mx.collections.ArrayCollection; import mx.events.FlexEvent; private var dg_array:Array; private var dg_arrayCollection:ArrayCollection; private function on_initialize(event:FlexEvent):void { dg_array = new Array(); dg_arrayCollection = new ArrayCollection(); dg_arrayCollection.addItem("item 1"); dg_arrayCollection.addItem("item 2"); dg.dataProvider = dg_arrayCollection; } ]]> </mx:Script> <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5"> <mx:columns> <mx:DataGridColumn headerText="Name" itemRenderer="SimpleItemRenderer"/> </mx:columns> </mx:DataGrid> </mx:Application> SimpleItemRenderer: <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" initialize="//on_initialize(event);"> <mx:Script> <![CDATA[ import mx.events.FlexEvent; [Bindable] override public function set data(value:Object):void { _data = value; } override public function get data():Object { return _data; } private var _data:Object; private function on_initialize_textInput(event:FlexEvent):void { trace("initialize:event.target="+event.target+", " + _data); // runs twice, for the first item only } private function on_creationComplete_textInput(event:FlexEvent):void { trace("creationComplete:event.target="+event.target+", " + _data); // runs twice, for the first item only } ]]> </mx:Script> <mx:TextInput text="{data}" id="textInput" initialize="on_initialize_textInput(event);" creationComplete="on_creationComplete_textInput(event);"/> </mx:Canvas> Abbreviated Output: initialize:event.target=ItemRenderers0.dg...SimpleItemRenderer12.textInput, null initialize:event.target=ItemRenderers0.dg...SimpleItemRenderer24.textInput, null creationComplete:event.target=ItemRenderers0.dg...SimpleItemRenderer24.textInput, item 1 initialize:event.target=ItemRenderers0.dg...SimpleItemRenderer29.textInput, null creationComplete:event.target=ItemRenderers0.dg...SimpleItemRenderer29.textInput, item 2 creationComplete:event.target=ItemRenderers0.dg...SimpleItemRenderer12.textInput, item 1

    Read the article

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