We do quite a bit of this at Truviso to dynamically generate Flex-based reports and live dashboards based on XML definitions. I think the details of how we do this could be improved, but the core structure is reasonably straightforward, through the magic of recursion. Basically, we have two types of components: Containers and Widgets. A Widget takes its XML definition and transforms our custom XML model to custom Flex components through a small series of (unfortunately) manual steps. A Container walks through its child definitions in the XML and instantiates new Containers or Widgets as appropriate. Having Factories for both Containers and Widgets helps keeps the coupling down.
Are there limits on the sorts of things expected from your XML layer, or have you been given the daunting task of re-implementing mxmlc in actionscript? -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -----Original Message----- From: Ilam Mougy <imo...@yahoo.com> Reply-to: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Best approach for Dynamic UI generation from XML... Date: Fri, 03 Apr 2009 12:31:07 -0000 I have a task of dynamically generating Flex UI forms from XML. I am free to design the look of the XML to be whatever I like. Is there a best approach to this problem, other than iterating over the XML and one by one creating objects that maps to Flex UI elements? Thanks,