Flex 1.5 - Container Activation by Theodore Patrick
This examples defines a method activateContainer to manage container properties in a generic way. Simply pass a target container to activate or deactivate it. The method consolidates management of many container properties and enabled state-like behavior in any container in Flex 1.5.
This method is very handy for dynamic layouts where you need to collapse and expand containers in place. Ideally you can call one method to show a certain container then call it again to hide the container. In many cases this model of activation enables you to use plain HBox and VBox rather than resorting to using ViewStacks with duplicate forms. I typically use this model to hide and expose optional form items or UI elements that are for advanced use and do not need to be seeing 80% of the time. Plus once you get the hang of it, you can see many layout options that were not tangible before.
There is also a subtle trick here that is worth noting. If you set a containers height or width to 'undefined', it will automatically resize to the minimum area of the containers children. This is very handy as you can adjust the view easily to accommodate an expanded or collapsed layout. Next time your struggling to resize a container to a minimum possible size, just set height and width to 'undefined'.
Open Example SWF in a New Window
This example is available with full source and documentation within Flex® by Example.
More to come.
Ted :)


0 Comments:
Post a Comment
<< Home