Spark: DataNavigators

At the last LFPUG I did a presentation on Flex 4 where I went through what I thought were the fundamental changes, and they showed some custom stuff I’d been working on. The plan was to then do a post on each slide explaining in a little more detail (which is still the plan), but there’s a few posts that talk about Navigators in Flex 4, and for anyone who visits this blog often you’ll be well aware of how much I use navigators.

With this in mind I thought I start posting some examples and open sourcing the code I’ve been working on, so today I thought I’d start with DataNavigators.

There are 3 components to talk about here. They all support virtualLayouts as long as the layout supports it. In building these I’ve ask a lot or questions of what others expected and try to implement the re-usability that is inherent in the spark framework.

—————————————————————-

DataNavigator

You can think of this to much like a DataGroup with 2 exceptions…

  • the layout must implement INavigatorLayout (a custom interface I’ll cover another day).
  • it implements ISelectableList
  • —————————————————————-

    SkinnableDataNavigator

    You can think of this much like a SkinnableDataGroup, with 3 exceptions…

  • the layout must implement INavigatorLayout (a custom interface I’ll cover another day).
  • it implements ISelectableList
  • the SkinPart it uses for displaying content has to be a DataNavigator
  • —————————————————————-

    BorderDataNavigator

    BorderDataNavigator extends SkinnableDataNavigator adding a border, in the same way as BorderContainer extends SkinnableContainer.

    —————————————————————-

    Here’s an example of the 3 of them in action using itemRenderers:

    (right click for source).

    The source for the code can be downloaded from our Google Code repository and includes

  • ws.tink.spark.components.DataNavigator
  • ws.tink.spark.components.SkinnableDataNavigator
  • ws.tink.spark.components.BorderDataNavigator
  • ws.tink.spark.skins.SkinnableDataNavigatorSkin
  • ws.tink.spark.skins.BorderDataNavigatorSkin
  • ws.tink.spark.layouts.supportClasses.INavigatorLayout
  • ws.tink.spark.layouts.supportClasses.NavigatorLayoutBase
  • ws.tink.spark.layouts.StackLayout
  • 6 Responses to “Spark: DataNavigators”

    1. James says:

      Useful stuff! I’ve just started the move from Flex 3 to Flex 4 & the shift in mentality about Viewstacks / Navigators got me good.

      Now we just need the awesome Efflex for Flex 4! ;)

    2. Tink says:

      On there way mate, along with some other bits and bobs.

    3. [...] Spark: DataNavigators Spark: DataNavigators – Elements instead of ItemRenderers [...]

    4. mico says:

      Great, is there any way to implement the ‘creationPolicy’ for this thing ?

    5. Tink says:

      Hi mico

      Due to this extending spark.components.DataGroup it doesn’t support creationPolicy, if you require that you should take a look at our Navigator or NavigatorGroup containers.

    Leave a Reply