Re: [flexcoders] Array to XML?
This might help: /** * Object To XML Conversion Mechanism For Structure * @param xmlData * @return * @author rtandon */ private static function makeXML(data:Object,rootNodeName:String):XML{ data = ObjectUtil.copy(data); var xmlData:XML = new XML(); var dataNode:XML; xmlData = <{rootNodeName}>; for (var prop:* in data){ dataNode = new XML(); if(data[prop] is String || data[prop] is int || data[prop] is Number || data[prop] is Boolean){ dataNode = <{prop}>{data[prop]}; xmlData = xmlData.appendChild(dataNode); }else if(data[prop] is Array || data[prop] is ArrayCollection){ xmlData = xmlData.appendChild(makeXMLCollection(data[prop],prop)); }else{ xmlData = xmlData.appendChild(makeXML(data[prop],prop)); } } return xmlData; } /** * Object To XML Conversion Mechanism For Table * @param data * @param rootNodeName * @return * @author rtandon */ private static function makeXMLCollection(data:Object,rootNodeName:String):XML{ data = ObjectUtil.copy(data); var xmlData:XML = new XML(); var itemNode:XML; xmlData = <{rootNodeName}>; for( var i:int;i; for (var prop:* in data){ dataNode = new XML(); if(data[prop] is String || data[prop] is int || data[prop] is Number || data[prop] is Boolean){ dataNode = <{prop}>{data[prop]}; xmlData = xmlData.appendChild(dataNode); }else if(data[prop] is Array || data[prop] is ArrayCollection){ xmlData = xmlData.appendChild(makeXMLCollection(data[prop],prop)); }else{ xmlData = xmlData.appendChild(makeXML(data[prop],prop)); } } return xmlData; } From: Venkat M To: "flexcoders@yahoogroups.com" Sent: Wednesday, August 31, 2011 5:59 AM Subject: [flexcoders] Array to XML? Hi group, Can some one please help me in converting an array into an xml file or a similar hierarchical data structure to be used for a tree component! Imagine a case I have an array A with values A1,A2,A3,A4, B1,B2,B3,B4, ….. Z1,Z2,Z3,Z4. Can I have an XML like .. .. . . . . . . . . .. .. So that I can directly link it to a tree component? Kindly help out!! Best Regards, Venkat Maddali.
Re: [flexcoders] adding and managing children dynamically - accordion
R u adding the datagrid after the accordian layout been created. Might be you have to check the sequence of events for the same. Sent from my iPhone On Aug 31, 2011, at 1:07 AM, Michael Sumner wrote: > > > I was trying to build a component that would dynamically add NavigatorContent > as children to an Accordion based on how many items were in an > ArrayCollection. That worked I got the expected number of accordion tabs > labeled correctly. I now want to add a DataGrid to each NavigatorContent. > > > > When I set a break point I do not see a reference to the NavigatorContent by > the id that I set when they were added to the Accordion or anywhere in the > component. > > > > How can I work with the DataGrid and set its DataProvider, etc? > > > > I will want to work with data in the DataGrid - crud > > > > I was trying to mimic what I had done using JQueryMobile with header tag and > queries return to the cfm page. They have a collapsible content block that > worked well on the small screen, but I need to be able to do more when a > larger screen is available. > > > > Any suggestion? > > > > > >
[flexcoders] Array to XML?
Hi group, Can some one please help me in converting an array into an xml file or a similar hierarchical data structure to be used for a tree component! Imagine a case I have an array A with values A1,A2,A3,A4, B1,B2,B3,B4, ….. Z1,Z2,Z3,Z4. Can I have an XML like .. .. . . . . . . . . .. .. So that I can directly link it to a tree component? Kindly help out!! Best Regards, Venkat Maddali.
[flexcoders] Axis Scale problem on Dual Axis Chart
I have a simply dual axis chart similar to the samples found all over the internet. The chart has a line series on one Linear vertical axis and a column series on another Linear vertical axis. The problem is that when certain events in the application happen, the min and max of one of the axis is reset to 0, 100. To avoid this I can set the min and max values, but I would like to avoid this as the axis should auto scale just like it does when it is first created. Here is some sample code to show the problem. The code is basically a chart with a button. When the button is clicked a new styleSheet is loaded and it is then that the axis is set to 0, 100. http://ns.adobe.com/mxml/2009"; xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" showStatusBar="false"> The style sheet which is loaded is basically a blank stylesheet which is compiled to swf. /* CSS file */ @namespace s "library://ns.adobe.com/flex/spark"; @namespace mx "library://ns.adobe.com/flex/mx"; global { font-family: "Verdana"; }
Re: [flexcoders] Re: Basic Doubt - Flex Module
Looks like I will have to have an interface that should be implemented by my all individual modules! I will give it a try!. Also I read an article just now to create modules is to make app modular, if we link the modules data to and fro it creates tight coupling and to avoid it we have to use interface. Best Regards, Venkat Maddali. > >From: valdhor >To: flexcoders@yahoogroups.com >Sent: Tuesday, August 30, 2011 5:37 AM >Subject: [flexcoders] Re: Basic Doubt - Flex Module > > > >Just to be different, I would use an interface between the Application and all >the modules. > >--- In flexcoders@yahoogroups.com, Alex Harui wrote: >> >> I would have the button listen for events from the module. >> >> >> On 8/29/11 4:12 PM, "Venkat M" wrote: >> >> >> >> >> >> >> >> Hi Group, >> >> I have a basic question on modules and module loader in flex. Can some on >> help out please? >> >> I have a main application that loads up any one of the available 4 (A,B,C,D) >> modules from a dropdown. The module loader in the main application is binded >> to the combobox of choice and the particular module loads up.For example if >> user selects A from combobox, module A.swf loads up. When the user changes >> the option to B in dropdown, the module loader unloads module A and loads >> Module B. This is the scenario. >> >> How can I control a logout button (activate/deactivate) in main application >> with the value of flag variable provided in all the modules. >> >> All the modules has a flag variable in them, when some action is being >> performed within the module the flag is set to 1, other wise 0; So my button >> on main application should be active only when the flag in the currently >> loaded module is 0. How do I deal with this. >> >> Thanks in advance!! >> >> Best Regards, >> Venkat Maddali. >> >> >> >> >> >> >> >> -- >> Alex Harui >> Flex SDK Team >> Adobe System, Inc. >> http://blogs.adobe.com/aharui >> > > > > >
Re: [flexcoders] Why don't horizontalCenter and verticalCenter work with Spark ColumnConstraints?
Can't do it. Boxes must be constrained via ConstraintColumns. The boxes switch sides, resize, appear and disappear, etc. via different states and there are transitions on those states to ease the boxes in as they move and resize. Picture a "reverse" button upper right that when clicked reverses the position of the boxes. When the boxes reverse, they smoothly transition to their new reversed positions. Those transitions won't work if the components are in different groups. They have to be horizontally centered on a ColumnConstraint, not a Group container. This isn't a new app. It's an existing app with a well designed UI. I'm just transitioning to Spark so as to take advantage of the new skinning model and facilitate parallel browser and mobile skins. Can't change the app's behavior in the process. In any event, I heard back from Adobe on this. They said, "we didn't have enough time to implement horizontal/verticalCenter in the last release (hopefully coming in the next!).". I asked if they meant for all Spark containers or what. They responded, "Yes, basically, they are not implemented in ConstraintLayout. ConstraintLayout handles all of the ConstraintColumns/ConstraintRows layout logic." So that leaves me stuck until the next release unless I can find a workaround. turbo_vb wrote: > > Constraints are designed to be used to constrain other components for > things like alignment and size. For your app, just add a group around > each of your containers and you're fine. > > -TH > > > http://ns.adobe.com/mxml/2009"; > xmlns:s="library://ns.adobe.com/flex/spark" > xmlns:mx="library://ns.adobe.com/flex/mx" > backgroundColor="blue"> > > backgroundColor="red" > bottom="100" > top="100"> > > > > width="{ width / 2 }" /> > width="{ width / 2 }" /> > > > > > height="100%" > left="col1:0" > right="col1:0"> > width="400" > height="300" > backgroundColor="green" > horizontalCenter="0" > verticalCenter="0" /> > > > height="100%" > left="col2:0" > right="col2:0"> > width="200" > height="150" > backgroundColor="yellow" > horizontalCenter="0" > verticalCenter="0" /> > > > > > > > --- In flexcoders@yahoogroups.com, RobertTr wrote: >> >> >> Here's code that splits the screen into two columns, left and right. Then >> it >> puts a box in each column and attempts to center them. The >> horizontalCenter >> and verticalCenter properties are ignored: >> >> >> http://ns.adobe.com/mxml/2009"; >> xmlns:s="library://ns.adobe.com/flex/spark" >> xmlns:mx="library://ns.adobe.com/flex/mx" >> backgroundColor="blue"> >> >> >> >> > top="100" bottom="100" >> backgroundColor="red"> >> >> >> >> > width="{width/2}" /> >> > width="{width/2}" /> >> >> >> >> >> > backgroundColor="green" >> width="400" height="300" >> horizontalCenter="col1:0" >> verticalCenter="0"> >> >> > backgroundColor="yellow" >> width="200" height="150" >> horizontalCenter="col2:0" >> verticalCenter="0"> >> >> >> >> >> -- >> View this message in context: >> http://old.nabble.com/Why-don%27t-horizontalCenter-and-verticalCenter-work-with-Spark-ColumnConstraints--tp32358020p32358020.html >> Sent from the FlexCoders mailing list archive at Nabble.com. >> > > > > -- View this mess
[flexcoders] adding and managing children dynamically - accordion
I was trying to build a component that would dynamically add NavigatorContent as children to an Accordion based on how many items were in an ArrayCollection. That worked I got the expected number of accordion tabs labeled correctly. I now want to add a DataGrid to each NavigatorContent. When I set a break point I do not see a reference to the NavigatorContent by the id that I set when they were added to the Accordion or anywhere in the component. How can I work with the DataGrid and set its DataProvider, etc? I will want to work with data in the DataGrid - crud I was trying to mimic what I had done using JQueryMobile with header tag and queries return to the cfm page. They have a collapsible content block that worked well on the small screen, but I need to be able to do more when a larger screen is available. Any suggestion?
[flexcoders] Re: Basic Doubt - Flex Module
Just to be different, I would use an interface between the Application and all the modules. --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > I would have the button listen for events from the module. > > > On 8/29/11 4:12 PM, "Venkat M" wrote: > > > > > > > > Hi Group, > > I have a basic question on modules and module loader in flex. Can some on > help out please? > > I have a main application that loads up any one of the available 4 (A,B,C,D) > modules from a dropdown. The module loader in the main application is binded > to the combobox of choice and the particular module loads up.For example if > user selects A from combobox, module A.swf loads up. When the user changes > the option to B in dropdown, the module loader unloads module A and loads > Module B. This is the scenario. > > How can I control a logout button (activate/deactivate) in main application > with the value of flag variable provided in all the modules. > > All the modules has a flag variable in them, when some action is being > performed within the module the flag is set to 1, other wise 0; So my button > on main application should be active only when the flag in the currently > loaded module is 0. How do I deal with this. > > Thanks in advance!! > > Best Regards, > Venkat Maddali. > > > > > > > > -- > Alex Harui > Flex SDK Team > Adobe System, Inc. > http://blogs.adobe.com/aharui >