On 5/18/08, Fiouz <[EMAIL PROTECTED]> wrote:
> On Sat, May 17, 2008 at 6:24 PM, Manish Jethani
> <[EMAIL PROTECTED]> wrote:
> >> What is the reason behind throwing an error when an array of
> >> DisplayObject is given? Why would I have to wrap my DisplayObject
> >> instances in order to prevent this error?
[snip]
> > By design, the data provider should be just that -- a data provider.
> >
> > Throwing an error for objects of type DisplayObject is more of a
> > "saving developers from shooting themselves in the foot" type of
> > thing, which personally I'm no big fan of, but that's just the way it
> > is now.
> It's unfortunate that it is prevented though, as my goal was to
> selectively display ViewStack children buttons (instead of a mere
> ViewStack binding that displays buttons for each child), i.e.:
>
> <ButtonBar id="buttons"/>
> <ViewStack id="vs">
> <custom:Chart id="chart" icons="...."/>
> <custom:Grid id="grid" icons="..."/>
> <custom:Form id="form"/> <!-- The buttonbar must NOT be able to
> select this child -->
> </ViewStack>
>
> I wanted my button bar not to show the "form button".
Wrapping the view stack children into an array of plain objects is the
only way to do that, from what I know.
Perhaps this would be cool:
<ButtonBar id="buttons"/>
<ViewStack id="vs">
<custom:Chart id="chart" icons="...."/>
<custom:Grid id="grid" icons="..."/>
<custom:Form id="form" includeInNavigation="false" />
</ViewStack>
i.e. a property that can mark a view to not be included in any
navigator controls.
But I think another way to achieve that is to simply not add the view
to the view stack. You can use states to declaratively add the form
view only later when the application switches to that state.