I have a case where a significant portion of the Flex page
needs to be redrawn with different widgets, layout and data with
certain user actions. I can do that in ActionScript but then I will
need to go through the tedious job of instantiating controls in
actionscript, adding properties and then adding them to the
application DOM. In DHTML, there is a really handy way of doing
that i.e. innerHTML allows you to set a HTML string and the browser
will automatically create DOM objects out of it.
I am looking for a innerMXML or something like that which
would take the MXML string and automatically create controls etc.
out of it and place them in the application DOM. Is it possible
with ActionScript 3.0? Is this functionality planned for future?
No, there is no way to do this with Flex. This is possible in
HTML because a browser's job is to parse and render HTML. The Flash
Player knows nothing about MXML. The only way to accomplish this
would be to create your own MXML parser and renderer in
ActionScript, which is not a good idea.