There is a bizarre limitation in MXML that if you were to create a container with child tags in it, you can no longer include any child tag if you were to use it when using the container in another MXML file.
Here is what the documentation says:
"...If you include child tags of the root container tag in an MXML component file, you cannot add child tags when you use the component as a custom tag in another MXML file. If you define an empty container in an MXML file, you can add child tags when you use the component as a custom tag.
Note: The restriction on child tags refers to the child tags that correspond to visual components. Visual components are subclasses of the UIComponent component. You can always insert tags for nonvisual components, such as ActionScript blocks, styles, effects, formatters, validators, and other types of nonvisual components, regardless of how you define your custom component."
Essentially, if you are creating a custom component that is a container, it will no longer be a container if you add child elements to it!
There may be a technical reason behind why this is not possible yet, but from a user's standpoint, it's an annoyance because it goes against the intuition and certainly violates the Principle of Least Surprise.
Essentially, if you are creating a custom component that is a container, it will no longer be a container if you add child elements to it!
There may be a technical reason behind why this is not possible yet, but from a user's standpoint, it's an annoyance because it goes against the intuition and certainly violates the Principle of Least Surprise.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home