Search Results

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

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

  • ArgumentError: Error #2004: One of the parameters is invalid.

    - by Florian
    I got the following stack trace while running a piece of code in my flex application: ArgumentError: Error #2004: One of the parameters is invalid. at ObjectOutput/writeObject() at mx.collections::ArrayList/writeExternal()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\collections\ArrayList.as:470] at mx.collections::ArrayCollection/writeExternal()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\collections\ArrayCollection.as:144] at flash.utils::ByteArray/writeObject() at mx.utils::ObjectUtil$/copy()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\utils\ObjectUtil.as:100] at components::SettingsHandler/saveOpenNodes()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\SettingsHandler.as:153] at components::soapjira/getIssuesByFilters()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\soapjira.as:295] at components.tabs::JiraAllActions/loadData()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\tabs\JiraAllActions.mxml:193] at components::SettingsHandler/settingsClosed()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\SettingsHandler.as:114] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:9408] at components.general::JiraSettings/closeSettings()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\general\JiraSettings.mxml:58] at components.general::JiraSettings/__save_click()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\general\JiraSettings.mxml:107] That stack comes up when running the following line (SettingsHandler.as:153): var tmp:Object = parentComponent.dataGrid.dataProvider.openNodes; I am actually copying the open nodes of a datagrid's provider. Has been working until now and just started going wrong, no idea what I have changed that could interfere with this. On debug mode, I see that openNodes is accessible and contains the open nodes, as expected. Doing tmp:Object = parentComponent.dataGrid.dataProvider.openNodes works, but not with ObjectUtil. (parentComponent is the reference to the component which contains the DG).

    Read the article

  • Flex: How to refresh/repaint a chart?

    - by Rob
    I have a chart for which the data is provided asynchronously via a CallResponder (used with a RemoteObject). However, it does not seem possible to update the chart with the data after it has been initially drawn. Here are the relevant snippets of (simplified) code: // code below is in the application MXML <mx:CallResponder id="result" result="resultHandler(event)" /> private function resultHandler(event:ResultEvent):void { // panel is an instance of ChartPanel this.panel.init(event.result); } // invoked when user clicks a button private function displayChart():void { this.currentState = "ShowChart"; result.token = remoteObject.getUrlStatistics(); } // code below is in ChartPanel <mx:BarChart id="chart" /> public function init(value:Object):void { var xml:XMLList = XMLList(value); var data:ArrayCollection = new ArrayCollection(); for each (var element:XML in xml.children()) { // not shown: extract value out of XML, put in ArrayList data.addItem(...); } this.chart.dataProvider = data; } The result is that it draws an empty chart. the resultHandler function or init function in ChartPanel needs to trigger a repaint or something similar. I have tried: Firing a collection modified event after assigning it to chart.dataProvider calling invalidateDisplayList (tried with all components) binding the chart data provider to a variable, and doing the above. changing the view state on the last line of resultHandler. None of them worked. When I fetch the data and cache it locally, then use it to call init synchronously, the chart displays correctly. What am I missing here?

    Read the article

  • Grouping Collection seperating numeric 5 from String "5"

    - by invertedSpear
    BackGround: I have an advanced data grid. The data provider for this ADG is an ArrayCollection. There is a grouping collection on an ID field of this AC. Example of a couple items within this AC the AC var name is "arcTemplates": (mx.collections::ArrayCollection)#0 filterFunction = (null) length = 69 list = (mx.collections::ArrayList)#1 length = 69 source = (Array)#2 [0] (Object)#3 abbreviation = "sore-throat" insertDate = "11/16/2009" name = "sore throat" templateID = 234 templateType = "New Problem" templateTypeID = 1 [32] (Object)#35 abbreviation = 123 insertDate = "03/08/2010" name = 123 templateID = 297 templateType = "New Problem" templateTypeID = 1 [55] (Object)#58 abbreviation = 1234 insertDate = "11/16/2009" name = 1234 templateID = 227 templateType = "Exam" templateTypeID = 5 [56] (Object)#59 abbreviation = "breast only" insertDate = "03/15/2005" name = "breast exam" templateID = 195 templateType = "Exam" templateTypeID = 5 Example of Flex code leading to the Grouping: <mx:AdvancedDataGrid displayItemsExpanded="true" id="gridTemplates"> <mx:dataProvider> <mx:GroupingCollection id="gc" source="{arcTemplates}"> <mx:Grouping > <mx:GroupingField name="templateTypeID" compareFunction="gcSort"> GC sort function: public function gcSort(a:Object, b:Object):int{ return ObjectUtil.stringCompare(String(a.templateTypeID + a.name).toLowerCase(), String(b.templateTypeID + b.name).toLowerCase()); } Problem: In my AC example there are a few items, items 0, 32 and 56 properly sort and group to their templateTypeID, but item 55 does something weird. It seems to sort/group on the numeric 5 instead of the string "5". Gets stranger. If I change the name property to contain text (so 1234x) it then correctly sorts/groups to the string "5" Question: What is going on here and how do I fix it?

    Read the article

  • TextArea being used as an itemEditor misbehaves when the enter key is pressed

    - by ChrisInCambo
    Hi, I have a TextArea inside an itemEditor component, the problem is that when typing in the TextArea if the enter key is pressed the itemEditor resets itself rather moving the caret to the next line as expected: <mx:List width="100%" editable="true" > <mx:dataProvider> <mx:ArrayCollection> <mx:Array> <mx:Object title="Stairway to Heaven" /> </mx:Array> </mx:ArrayCollection> </mx:dataProvider> <mx:itemRenderer> <mx:Component> <mx:Text height="100" text="{data.title}"/> </mx:Component> </mx:itemRenderer> <mx:itemEditor> <mx:Component> <mx:TextArea height="100" text="{data.title}"/> </mx:Component> </mx:itemEditor> </mx:List> </mx:Application> Could anyone advise how I can get around this strange behaviour and make the enter key behave as expected? Thanks, Chris

    Read the article

  • How to parse XML to flex Data Grid contents.

    - by Jeeva
    My xml file which is in a webserver is show below. <root> <userdetails> <username>raja</username> <status>offline</status> </userdetails> <userdetails> <username>Test</username> <status>online</status> </userdetails> </root> How can i parse this to flex data grid contents. I tried with below coding < ?xml version="1.0" encoding="utf-8"? < mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" < mx:HTTPService id="userList" result="handleData(event)" resultFormat="object" url="http://apps.facebook.com/ajparkin/user_list.xml" / <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.controls.Alert; public function initApp():void { userList.send(); } [Bindable] var userdetailsArray:ArrayCollection; private function handleData(evt:ResultEvent):void { this.userdetailsArray= evt.result.userdetails; } ]]> </mx:Script> <mx:DataGrid dataProvider="{userdetailsArray}"> <mx:columns> <mx:DataGridColumn dataField="username" headerText="User Name"/> <mx:DataGridColumn dataField="status" headerText="Status" /> </mx:columns> </mx:DataGrid> </mx:Application> I'm getting only the field names not the data.

    Read the article

  • Flex 3 - Image cache

    - by BS_C3
    Hello Community. I'm doing an Image Cache following this method: http://www.brandondement.com/blog/2009/08/18/creating-an-image-cache-with-actionscript-3/ I copied the two as classes, renaming them CachedImage and CachedImageMap. The thing is that I don't want to store the image after being loaded a first time, but while the application is being loaded. For that, I've created a function that is called by the application pre-initialize event. This is how it looks: private function loadImages():void { var im:CachedImage = new CachedImage; var sources:ArrayCollection = new ArrayCollection; for each(var cs in divisionData.division.collections.collection.collectionSelection) { sources.addItem(cs.toString()); } for each(var se in divisionData.division.collections.collection.searchEngine) { sources.addItem(se.toString()); } for each( var source:String in sources) { im.source = source; im.load(source); } } The sources are properly retrieved. However, even if I use the load method, I do not get the "complete" event... As if the image is not being loaded... How is that? Any help would be appreciated. Thanks in advance. Regards, BS_C3

    Read the article

  • Flex bar chart with Two Y axis

    - by user345522
    I am trying to create a bar char in action 3 script. But for some reason I am getting 2 y-axis and no x axis. Can some one help spot the error. I have said "placement " bottom. The standalone code snippet is below. enter code here [Bindable] public var QUANTITY:ArrayCollection = new ArrayCollection([ {date:"22-Aug-05", quantity:1575.9}, {date:"23-Aug-05", quantity:1603.}, {date:"24-Aug-05", quantity:1507.1}, {date:"25-Aug-05", quantity:1568.8}, ]); private function getBarChartData(evt:MouseEvent):void{ var title:String = "ASDFZXCVB"; var pnlChart:Panel = new Panel(); pnlChart.title = title; pnlChart.height = 750; { var categoryAxisDate:CategoryAxis = new CategoryAxis(); categoryAxisDate.categoryField = "date"; var linearVolumeAxis:LinearAxis = new LinearAxis(); linearVolumeAxis.minimum = 1500; linearVolumeAxis.maximum = 1700; var colChart:ColumnChart = new ColumnChart(); colChart.showDataTips = true; { var horizontalAxisDateRenderer:AxisRenderer = new AxisRenderer(); horizontalAxisDateRenderer.axis = categoryAxisDate; horizontalAxisDateRenderer.placement = "bottom"; var quantityRenderer:AxisRenderer = new AxisRenderer(); quantityRenderer.axis = linearVolumeAxis; quantityRenderer.placement = "left"; colChart.horizontalAxisRenderers.push(horizontalAxisDateRenderer); colChart.verticalAxisRenderers.push(quantityRenderer); { var quantityColumnSeries:ColumnSeries = new ColumnSeries(); quantityColumnSeries.horizontalAxis = categoryAxisDate; quantityColumnSeries.yField="quantity"; quantityColumnSeries.displayName ="QUANTITY"; quantityColumnSeries.dataProvider = QUANTITY; quantityColumnSeries.verticalAxis = linearVolumeAxis; colChart.series.push(quantityColumnSeries); } } pnlChart.addChild(colChart); } canvasReportId.addChild(pnlChart); } ]] <mx:Button label="Submit" click="getBarChartData(event)" x="293" y="4"/> </mx:Canvas>

    Read the article

  • Repeater not working fine when passed a dataprovider (array) having a single element

    - by baltusaj
    I am using a Repeater in an Accordian which does not appear to see a single element in userArray. If I add another entry to userArray then the Repeater works fine. Thoughts?? private function currUsersServiceHandler(event:ResultEvent):void{ if (event.result.currentUsers != null) { if (event.result.currentUsers.user is ArrayCollection) // if more than one elements are present { usersArray = event.result.currentUsers.user; } else if (event.result.currentUsers is ObjectProxy) { //FIXIT usersArray populate by following line has some issue usersArray = new ArrayCollection(ArrayUtil.toArray(event.result.currentUsers)); } } } <mx:HTTPService id="currUsersService" url="currUsers.xml" result="currUsersServiceHandler(event)"/> <mx:Accordion includeIn="UserList" x="10" y="10" width="554" height="242" > <mx:Repeater id="rep" dataProvider="{usersArray}"> <mx:Canvas width="100%" height="100%" label="{rep.currentItem.firstName}" > <mx:HBox> <s:Label text="{rep.currentItem.firstName}"/> <s:Label text="{rep.currentItem.lastName}"/> <mx:/HBox> </mx:Canvas> </mx:Repeater> </mx:Accordian> Edit: There is another thing I have just noticed i.e. that the accordian does show a single tab (when Array has a single element) but it's not labeled with the first name which I am setting. If I enter another user, two tabs appear and both are labeled with names I am setting. The first tab appears labeled too then.

    Read the article

  • flex Dictionary dataProvider?

    - by paleozogt
    I have a Dictionary that I'd like to bind as the dataProvider for an mx:ComboBox. e.g., when I do this: mydict[somenewkey]= somenewval; I'd like the combobox to update its contents. The problem is that Dictionary doesn't seem to be Bindable. If I were using an Array, I'd use ArrayCollection. But there doesn't seem to be a corresponding DictionaryCollection or HashCollection. What to do?

    Read the article

  • Flex - Problem with auto resizing datagrid

    - by Marty Pitt
    Hi All I'm trying to create a datagrid which will resize vertically to ensure all the renderers are displayed in full. Additionally, Renderers are of variable height Renderers can resize themselves Generally speaking, the flow of events is as follows : One of the item renderers resizes itself (normally in response to a user click etc) It dispatches a bubbling event which the parent datagrid picks up The DataGrid attempts to resize to ensure that all renderers remain visible in full. I'm currently using this code within the datagrid to calculate the height: height = measureHeightOfItems(0, dataProvider.length ) + headerHeight; This appears to get an incorrect height. I've tried a number of variations including callLater ( to ensure the resize has completed so measure can work correctly), and overriding meausre() and calling invalidateSize() / validateSize(), but neither works. Below are 3 classes which will illustrate the problem. Clicking the button in the item renderers resizes the renderer. The grid should also expand so that all of the 3 renderers are shown in their entirety. Any suggestions would be greatly appreciated. Regards Marty DataGridProblem.mxml (Application file) <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:view="view.*"> <mx:ArrayCollection id="dataProvider"> <mx:String>Item A</mx:String> <mx:String>Item B</mx:String> <mx:String>Item C</mx:String> </mx:ArrayCollection> <view:TestDataGrid id="dg" dataProvider="{ dataProvider }" width="400"> <view:columns> <mx:DataGridColumn dataField="text" /> <mx:DataGridColumn itemRenderer="view.RendererButton" /> </view:columns> </view:TestDataGrid> </mx:Application> view.TestDataGrid.as package view { import flash.events.Event; import mx.controls.DataGrid; import mx.core.ScrollPolicy; public class TestDataGrid extends DataGrid { public function TestDataGrid() { this.verticalScrollPolicy = ScrollPolicy.OFF; this.variableRowHeight = true; this.addEventListener( RendererButton.RENDERER_RESIZE , onRendererResize ); } private function onRendererResize( event : Event ) : void { resizeDatagrid(); } private function resizeDatagrid():void { height = measureHeightOfItems(0, dataProvider.length ) + headerHeight; } } } view.RendererButton.mxml <?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Button width="50" height="50" click="onClick()" /> <mx:Script> <![CDATA[ public static const RENDERER_RESIZE : String = "resizeRenderer"; private function onClick() : void { this.height += 20; dispatchEvent( new Event( RENDERER_RESIZE , true ) ); } ]]> </mx:Script> </mx:HBox>

    Read the article

  • Flex - Issues with linkbar dataprovider

    - by BS_C3
    Hello Community! I'm having some issues displaying a linkbar. The data I need to display is in a XML file. However, I couldn't get the linkbar to display a xmllist (I did indeed read that you cannot set a xmlllist as a linkbar dataprovider... ). So, I'm transforming the xmllist in a array of objects. Here is some code. XML file: <data> <languages> <language id="en"> <label>ENGLISH</label> <source></source> </language> <language id="fr"> <label>FRANCAIS</label> <source></source> </language> <language id="es"> <label>ESPAÑOL</label> <source></source> </language> <language id="jp"> <label>JAPANESE</label> <source></source> </language> </languages> </data> AS Code that transforms the xmllist in an array of objects: private function init():void { var list:XMLList = generalData.languages.language; var arr:ArrayCollection = new ArrayCollection; var obj:Object; for(var i:int = 0; i<list.length(); i++) { obj = new Object; obj.id = list[i].@id; obj.label = list[i].label; obj.source = list[i].source; arr.addItemAt(obj, arr.length); } GlobalData.instance.languages = arr.toArray(); } Linkbar code: <mx:HBox horizontalAlign="right" width="100%"> <mx:LinkBar id="language" dataProvider="{GlobalData.instance.languages}" separatorWidth="3" labelField="{label}"/> </mx:HBox> The separator is not displaying, and neither do the label. But the array is populated (I tested it). Thanks for any help you can provide =) Regards, BS_C3

    Read the article

  • Power function fit to data set

    - by czerasz
    I have a set of data (in ArrayCollection) and I need to fit a power function { f(x)= B + x^alpha } to it, before display in LineChart. As result I need the alpha and B paremeter. How to do this with Flex?

    Read the article

  • How can we retrieve value on main.mxml from other .mxml?

    - by Roshan
    main.mxml [Bindable] private var _dp:ArrayCollection = new ArrayCollection([ {day:"Monday", dailyTill:7792.43}, {day:"Tuesday", dailyTill:8544.875}, {day:"Wednesday", dailyTill:6891.432}, {day:"Thursday", dailyTill:10438.1}, {day:"Friday", dailyTill:8395.222}, {day:"Saturday", dailyTill:5467.00}, {day:"Sunday", dailyTill:10001.5} ]); public var hx:String ; public function init():void { //parameters is passed to it from flashVars //values are either amount or order hx = Application.application.parameters.tab; } ]]> </mx:Script> <mx:LineChart id="myLC" dataProvider="{_dp}" showDataTips="true" dataTipRenderer="com.Amount" > <mx:horizontalAxis> <mx:CategoryAxis categoryField="day" /> </mx:horizontalAxis> <mx:series> <mx:LineSeries xField="day" yField="dailyTill"> </mx:LineSeries> </mx:series> </mx:LineChart> com/Amount.mxml [Bindable] private var _dayText:String; [Bindable] private var _dollarText:String; override public function set data(value:Object):void{ //Alert.show(Application.application.parameters.tab); //we know to expect a HitData object from a chart, so let's cast it as such //so that there aren't any nasty runtime surprises var hd:HitData = value as HitData; //Any HitData object carries a reference to the ChartItem that created it. //This is where we need to know exactly what kind of Chartitem we're dealing with. //Why? Because a pie chart isn't going to have an xValue and a yValue, but things //like bar charts, column charts and, in our case, line charts will. var item:LineSeriesItem = hd.chartItem as LineSeriesItem; //the xValue and yValue are returned as Objects. Let's cast them as strings, so //that we can display them in the Label fields. _dayText = String(item.xValue); var hx : String = String(item.yValue) _dollarText = hx.replace("$"," "); }//end set data ]]> </mx:Script> QUES : Amount.mxml is used as dataTipRenderer for line chart. Now, I need to obtain the value assigned to variable "hx" in main.mxml from "com/Amount.mxml".Any help would be greatly appreciated?

    Read the article

  • Using mx.charts in a Flex Hero mobile project

    - by Alexander Farber
    Hello, Adobe states that Charts are supported in mobile projects but when I try to change the following working files (created project with File - New - Flex Mobile Project - Google Nexus One): MyTest.mxml: <?xml version="1.0" encoding="utf-8"?> <s:MobileApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.MyTestHome"> <s:navigationContent> <s:Button label="Home" click="navigator.popToFirstView();"/> </s:navigationContent> <s:actionContent/> </s:MobileApplication> MyTestHome.mxml: <?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" title="Test Chart"> </s:View> to the new MyTestHome.mxml: <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" title="Test Chart"> <fx:Script> <![CDATA[ import mx.collections.*; [Bindable] private var medalsAC:ArrayCollection = new ArrayCollection( [ {Country: "USA", Gold: 35, Silver:39, Bronze: 29 }, {Country:"China", Gold: 32, Silver:17, Bronze: 14 }, {Country:"Russia", Gold: 27, Silver:27, Bronze: 38 } ]); ]]> </fx:Script> <mx:PieChart id="chart" height="100%" width="100%" paddingRight="5" paddingLeft="5" color="0x323232" dataProvider="{medalsAC}" > <mx:series> <mx:PieSeries labelPosition="callout" field="Gold"> <mx:calloutStroke> <s:SolidColorStroke weight="0" color="0x888888" alpha="1.0"/> </mx:calloutStroke> <mx:radialStroke> <s:SolidColorStroke weight="0" color="#FFFFFF" alpha="0.20"/> </mx:radialStroke> <mx:stroke> <s:SolidColorStroke color="0" alpha="0.20" weight="2"/> </mx:stroke> </mx:PieSeries> </mx:series> </mx:PieChart> </s:View> and also add c:\Program Files\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\datavisualization.swc c:\Program Files\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\sparkskins.swc c:\Program Files\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\mx\mx.swc to Flex Build Path (clicking "Add SWC" button): Then it fails with the error: Could not resolve to a component implementation. Does anybody please have an idea here? Alex

    Read the article

  • In Flex, how to drag a component into a column of DataGrid (not the whole DataGrid)?

    - by Yousui
    Hi guys, I have a custom component: <?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"> <fx:Declarations> </fx:Declarations> <fx:Script> <![CDATA[ [Bindable] public var label:String = "don't know"; [Bindable] public var imageName:String = "x.gif"; ]]> </fx:Script> <s:HGroup paddingLeft="8" paddingTop="8" paddingRight="8" paddingBottom="8"> <mx:Image id="img" source="assets/{imageName}" /> <s:Label text="{label}"/> </s:HGroup> </s:Group> and a custom render, which will be used in my DataGrid: <?xml version="1.0" encoding="utf-8"?> <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true" xmlns:components="components.*"> <s:VGroup> <components:Person label="{dataGridListData.label}"> </components:Person> </s:VGroup> </s:MXDataGridItemRenderer> This is my application: <?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" xmlns:services="services.*"> <s:layout> <s:VerticalLayout/> </s:layout> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.controls.Image; import mx.rpc.events.ResultEvent; import mx.utils.ArrayUtil; ]]> </fx:Script> <fx:Declarations> <fx:XMLList id="employees"> <employee> <name>Christina Coenraets</name> <phone>555-219-2270</phone> <email>[email protected]</email> <active>true</active> <image>assets/001.png</image> </employee> <employee> <name>Joanne Wall</name> <phone>555-219-2012</phone> <email>[email protected]</email> <active>true</active> <image>assets/002.png</image> </employee> <employee> <name>Maurice Smith</name> <phone>555-219-2012</phone> <email>[email protected]</email> <active>false</active> <image>assets/003.png</image> </employee> <employee> <name>Mary Jones</name> <phone>555-219-2000</phone> <email>[email protected]</email> <active>true</active> <image>assets/004.png</image> </employee> </fx:XMLList> </fx:Declarations> <s:HGroup> <mx:DataGrid dataProvider="{employees}" width="100%" dropEnabled="true"> <mx:columns> <mx:DataGridColumn headerText="Employee Name" dataField="name"/> <mx:DataGridColumn headerText="Email" dataField="email"/> <mx:DataGridColumn headerText="Image" dataField="image" itemRenderer="renderers.render1"/> </mx:columns> </mx:DataGrid> <s:List dragEnabled="true" dragMoveEnabled="false"> <s:dataProvider> <s:ArrayCollection> <fx:String>aaa</fx:String> <fx:String>bbb</fx:String> <fx:String>ccc</fx:String> <fx:String>ddd</fx:String> </s:ArrayCollection> </s:dataProvider> </s:List> </s:HGroup> </s:Application> Now what I want to do is let the user drag an one or more item from the left List component and drop at the third column of the DataGrid, then using the dragged data to create another <components:Person /> object. So in the final result, maybe the first line contains just one <components:Person /> object at the third column, the second line contains two <components:Person /> object at the third column and so on. Can this be implemented in Flex? How? Great thanks.

    Read the article

  • how to build flex stack bar chart from objects array?

    - by AngelHeart
    I have a dynamic ArrayCollection that will contain a unknown number of objects of type MyObj: class MyObj { type:String value:long } where each MyObj object has a different value of "type". how can I build a single stacked bar from this array where each section of the stacked bar represents an object of MyObj (represents a "type") and its length is the value?

    Read the article

  • How to make sliding button sidebar in Flex

    - by Tam
    Hi, I'm fairly new to Flex. I want to make a button (icon) on the far right in the middle of the page that display a sliding side bar with multiple buttons in it when you hover over it. I want when the user hover out of the button bar it slides back again. Conceptually I got the basics of that to work. The issue I'm having is that when the user moves the mouse between the buttons in the sidebar it kicks in changing state and side bar slides back again. I tried using different types of containers and I got the same results. Any Advice? Thanks, Tam Here is the code: <?xml version="1.0" encoding="utf-8"?> <s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:vld ="com.lal.validators.*" xmlns:effect="com.lal.effects.*" width="150" horizontalAlign="right" gap="0"> <fx:Script> <![CDATA[ import com.lal.model.LalModelLocator; var _model:LalModelLocator = LalModelLocator.getInstance(); ]]> </fx:Script> <fx:Declarations> <mx:ArrayCollection id="someData"> </mx:ArrayCollection> </fx:Declarations> <s:states> <s:State name="normal" /> <s:State name="expanded" /> </s:states> <fx:Style source="/styles.css"/> <s:transitions> <s:Transition fromState="normal" toState="expanded" > <s:Sequence> <s:Wipe direction="left" duration="250" target="{buttonsGroup}" /> </s:Sequence> </s:Transition> <s:Transition fromState="expanded" toState="normal" > <s:Sequence> <s:Wipe direction="right" duration="250" target="{buttonsGroup}" /> </s:Sequence> </s:Transition> </s:transitions> <s:Button skinClass="com.lal.skins.CalendarButtonSkin" id="calendarIconButton" includeIn="normal" verticalCenter="0" mouseOver="currentState = 'expanded'"/> <s:Panel includeIn="expanded" id="buttonsGroup" mouseOut="currentState = 'normal' " width="150" height="490" > <s:layout> <s:VerticalLayout gap="0" paddingRight="0" /> </s:layout> <s:Button id="mondayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> <s:Button id="tuesdayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> <s:Button id="wednesdayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> <s:Button id="thursdayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> <s:Button id="fridayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> <s:Button id="saturdayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> <s:Button id="sundayButton" width="120" height="70" mouseOver="currentState = 'expanded'"/> </s:Panel> </s:VGroup>

    Read the article

  • pass data from popup to parent

    - by user522962
    I have a parent w/ a popup child. When parent loads, I have to call a function within the popup without showing the popup (thus, I load "pupLove" but don't include it in layout)....I then pass this data to the parent. When the user manually clicks another button to open the popup, the same function is called & data passed to the parent. However, I am not able to pass dg.length to the parent. I believe the root problem is that I am loading "pupLove" & thus the parents are getting confused.....I'm guessing if I get rid of "pupLove" I can pass the data correctly but will need to call the child's function at creationComplete of the parent....how do I do that? Here's my parent: <?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" backgroundColor="green" width="50%" height="100%" xmlns:local="*" > <fx:Script> <![CDATA[ import pup; import mx.managers.PopUpManager; public function showPup(evt:MouseEvent):void { var ttlWndw:pup = PopUpManager.createPopUp(this, pup, true) as pup; PopUpManager.centerPopUp(ttlWndw); } ]]> </fx:Script> <mx:VBox> <local:pup id="pupLove" visible="false" includeInLayout="false" /> <s:Button click="showPup(event);" label="launch Pup" /> <mx:Text id="Ptest" color="black" text="from Parent:{pupLove.dg.length}" /> </mx:VBox> </s:Application> And a popup child called 'pup.mxml': <?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"> <fx:Script> <![CDATA[ public function init():void{ // send php call } import mx.events.CloseEvent; import mx.managers.PopUpManager; private function removePup(evt:Event):void { PopUpManager.removePopUp(this); } ]]> </fx:Script> <fx:Declarations> <s:ArrayCollection id="dg"> </s:ArrayCollection> </fx:Declarations> <s:TitleWindow width="100%" height="100%" close="removePup(event)"> <mx:VBox> <mx:Text id="test" color="red" text="from Child:{dg.length}" /> <s:Button label="add Items" click="dg.addItem({id:'cat'})" /> </mx:VBox> </s:TitleWindow> </s:Group> UPDATE: I guess my question can be more easily stated as: "is there a way to call a child's function from the parent without actually loading the child?"

    Read the article

  • convert remote object result to array collection in flex...........

    - by user364199
    HI guys, im using zend_amf and flex. My problem is i have to populate my advance datagrid using array collection. this array collection have a children. example: [Bindable] private var dpHierarchy:ArrayCollection = new ArrayCollection([ {trucks:"Truck", children: [ {trucks:"AMC841", total_trip:1, start_time:'3:46:40 AM'}, {trucks:"AMC841", total_trip:1, start_time:'3:46:40 AM'}]) ]}; but the datasource of my datagrid should come from a database, how can i convert the result from remote object to array collection that has the same format like in my example, or any other way. here is my advance datagrid <mx:AdvancedDataGrid id="datagrid" width="500" height="200" lockedColumnCount="1" lockedRowCount="0" horizontalScrollPolicy="on" includeIn="loggedIn" x="67" y="131"> <mx:dataProvider> <mx:HierarchicalData id="dpHierarchytest" source="{dp}"/> </mx:dataProvider> <mx:groupedColumns> <mx:AdvancedDataGridColumn dataField="trucks" headerText="Trucks"/> <mx:AdvancedDataGridColumn dataField="total_trip" headerText="Total Trip"/> <mx:AdvancedDataGridColumnGroup headerText="PRECOOLING"> <mx:AdvancedDataGridColumnGroup headerText="Before Loading"> <mx:AdvancedDataGridColumn dataField="start_time" headerText="Start Time"/> <mx:AdvancedDataGridColumn dataField="end_time" headerText="End Time"/> <mx:AdvancedDataGridColumn dataField="precooling_time" headerText="Precooling Time"/> <mx:AdvancedDataGridColumn dataField="precooling_temp" headerText="Precooling Temp"/> </mx:AdvancedDataGridColumnGroup> <mx:AdvancedDataGridColumnGroup headerText="Before Dispatch"> <mx:AdvancedDataGridColumn dataField="bd_start_time" headerText="Start Time"/> <mx:AdvancedDataGridColumn dataField="bd_end_time" headerText="End Time"/> <mx:AdvancedDataGridColumn dataField="bd_precooling_time" headerText="Precooling Time"/> <mx:AdvancedDataGridColumn dataField="bd_precooling_temp" headerText="Precooling Temp"/> </mx:AdvancedDataGridColumnGroup> <mx:AdvancedDataGridColumn dataField="remarks" headerText="Remarks"/> </mx:AdvancedDataGridColumnGroup> <mx:AdvancedDataGridColumnGroup headerText="Temperature Compliance"> <mx:AdvancedDataGridColumn dataField="total_hit" headerText="Total Hit"/> <mx:AdvancedDataGridColumn dataField="total_miss" headerText="Total Miss"/> <mx:AdvancedDataGridColumn dataField="cold_chain_compliance" headerText="Cold Chain Compliance"/> <mx:AdvancedDataGridColumn dataField="average_temp" headerText="Average Temp"/> </mx:AdvancedDataGridColumnGroup> <mx:AdvancedDataGridColumnGroup headerText="Productivity"> <mx:AdvancedDataGridColumn dataField="total_drop_points" headerText="Total Drop Points"/> <mx:AdvancedDataGridColumn dataField="total_delivery_time" headerText="Total Delivery Time"/> <mx:AdvancedDataGridColumn dataField="total_distance" headerText="Total Distance"/> </mx:AdvancedDataGridColumnGroup> <mx:AdvancedDataGridColumnGroup headerText="Trip Exceptions"> <mx:AdvancedDataGridColumn dataField="total_doc" headerText="Total DOC"/> <mx:AdvancedDataGridColumn dataField="total_eng" headerText="Total ENG"/> <mx:AdvancedDataGridColumn dataField="total_fenv" headerText="Total FENV"/> <mx:AdvancedDataGridColumn dataField="average_speed" headerText="Average Speed"/> </mx:AdvancedDataGridColumnGroup> </mx:groupedColumns> </mx:AdvancedDataGrid> Thanks, and i really need some help.

    Read the article

  • Using Mate's RemoteObjectInvoker with C# classes

    - by FigBug
    I'm using the Mate framework for Flex and communicating with a server running C#. I'm having trouble mapping C# classes to ActopnScript classes. I've got it working fine for simple classes and built in datatypes. If I have a C# method in my API that returns a API.Foo.Result what name do I use for my RemoteClass alias? Do I need to make a separate ActionScript class for each variation of the API.Foo.Result? How do I call C# method that takes a class as a parameter? Making an ActionScript class with members with the same names doesn't seem to work. What is the best way to handle C# classes that contain arrays of objects? The seem to get converted to ArrayCollections of Object. Is there a way to get them converted to an ArrayCollection of my specific class?

    Read the article

  • problem processing xml in flex3

    - by john
    Hi All, First time here asking a question and still learning on how to format things better... so sorry about the format as it does not look too well. I have started learning flex and picked up a book and tried to follow the examples in it. However, I got stuck with a problem. I have a jsp page which returns xml which basically have a list of products. I am trying to parse this xml, in other words go through products, and create Objects for each product node and store them in an ArrayCollection. The problem I believe I am having is I am not using the right way of navigating through xml. The xml that is being returned from the server looks like this: <?xml version="1.0" encoding="ISO-8859-1"?><result type="success"> <products> <product> <id>6</id> <cat>electronics</cat> <name>Plasma Television</name> <desc>65 inch screen with 1080p</desc> <price>$3000.0</price> </product> <product> <id>7</id> <cat>electronics</cat> <name>Surround Sound Stereo</name> <desc>7.1 surround sound receiver with wireless speakers</desc> <price>$1000.0</price> </product> <product> <id>8</id> <cat>appliances</cat> <name>Refrigerator</name> <desc>Bottom drawer freezer with water and ice on the door</desc> <price>$1200.0</price> </product> <product> <id>9</id> <cat>appliances</cat> <name>Dishwasher</name> <desc>Large capacity with water saver setting</desc> <price>$500.0</price> </product> <product> <id>10</id> <cat>furniture</cat> <name>Leather Sectional</name> <desc>Plush leather with room for 6 people</desc> <price>$1500.0</price> </product> </products></result> And I have flex code that tries to iterate over products like following: private function productListHandler(e:JavaFlexStoreEvent):void { productData = new ArrayCollection(); trace(JavaServiceHandler(e.currentTarget).response); for each (var item:XML in JavaServiceHandler(e.currentTarget).response..product ) { productData.addItem( { id:item.id, item:item.name, price:item.price, description:item.desc }); } } with trace, I can see the xml being returned from the server. However, I cannot get inside the loop as if the xml was empty. In other words, JavaServiceHandler(e.currentTarget).response..product must be returning nothing. Can someone please help/point out what I could be doing wrong. My JavaServiceHandler class looks like this: package com.wiley.jfib.store.data { import com.wiley.jfib.store.events.JavaFlexStoreEvent; import flash.events.Event; import flash.events.EventDispatcher; import flash.net.URLLoader; import flash.net.URLRequest; public class JavaServiceHandler extends EventDispatcher { public var serviceURL:String = ""; public var response:XML; public function JavaServiceHandler() { } public function callServer():void { if(serviceURL == "") { throw new Error("serviceURL is a required parameter"); return; } var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, handleResponse); loader.load(new URLRequest(serviceURL)); // var httpService:HTTPService = new HTTPService(); // httpService.url = serviceURL; // httpService.resultFormat = "e4x"; // httpService.addEventListener(Event.COMPLETE, handleResponse); // httpService.send(); } private function handleResponse(e:Event):void { var loader:URLLoader = URLLoader(e.currentTarget); response = XML(loader.data); dispatchEvent(new JavaFlexStoreEvent(JavaFlexStoreEvent.DATA_LOADED) ); // var httpService:HTTPService = HTTPService(e.currentTarget); // response = httpService.lastResult.product; // dispatchEvent(new JavaFlexStoreEvent(JavaFlexStoreEvent.DATA_LOADED) ); } } } Even though I refer to this as mine and it is not in reality. This is from a Flex book as a code sample which does not work, go figure. Any help is appreciated. Thanks john

    Read the article

  • Deserialize XML to custom Class in Flex?

    - by MysticEarth
    Is it possible to deserialize an XML file to a class in Flex without manually checking the XML and/or creating the class, with the help of a HttpService? Edit: Explained a bit more and better. We have an XML file which contains: <Project> <Name>NameGoesHere</Name> <Number>15</Number> </Project> In Flex we want this to be serialized to our Project class: package com.examplepackage { import mx.collections.ArrayCollection; [XmlClass] public class Project { public var Name:String; public var Number:int; public function Project() { } } } The XML is loaded with a HTTPService.

    Read the article

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