Tuesday, May 7, 2013

Flex DeferredContentGroup Component

Whereas Flex 3 included built-in support for deferred content creation in all of the Halo containers, Flex 4 only offers this feature with the SkinnableContainer Spark container. With the DeferredContentGroup, you can utilize deferred instantiation in the lighter-weight Spark Group container.

I created this, primarily, because I needed it for the new Spark ViewStack navigator that I’m currently working on (which I’ll be wrapping up and releasing soon), but I saw no reason to not release this as a standalone component.

I didn’t feel like I needed to post a demo or directions on how to use this. If you know how to use a Group and you know how to use the creationPolicy attribute, then you know how to use this component (although I do have a demo checked into the source code repository).

Source  code located at: https://www.assembla.com/code/shinynet/subversion/nodes

3 comments:

  1. Hey Devin, have you looked at my DeferredGroup and StackLayout?

    http://svn.apache.org/viewvc/flex/whiteboard/tink/navigators/src/ws/tink/spark/containers/DeferredGroup.as?view=log
    http://svn.apache.org/viewvc/flex/whiteboard/tink/navigators/src/ws/tink/spark/layouts/StackLayout.as?view=log

    http://www.tink.ws/blog/flex-4-navigator/

    ReplyDelete
  2. Hey Stephen, I have seen those, but I may want to take another look to see if if there's anything important I missed in this version :)

    One thing I did require was that the deferred group to extend Group instead of GroupBase because I wanted to substitute the contentGroup skin part in a SkinnableContainer with a deferred version. Had I gone with anything other than Group would've required dealing with skin part changes.

    ReplyDelete
  3. Not sure my last comment made it through, but I think you could replace your SkinnableContainer with a Navigator which would expose selectedIndex/selectedItem and syncing with the navigator layouts. You'd have to update the skin to contain a NavigatorGroup (which extends DeferredGroup), instead of a Group though.

    ReplyDelete