Hi Nick,
Thanks for the help, the reasons why I'm not satisfied with #5 are
like that: The tabs naming is one operation that takes place, another
one is creating a ViewStack object to correspond those tabs.
Obviously, the view stack Can be built upon setting the TabBar
dataProvider, however, I think it's not readable beacuse when I open
an mxml component in search for a specific view control, the viewstack
in this example, I would look first at the <mx:ViewStack /> tag
instead, not at the TabBar, which should have nothing to do with the
ViewStack leaving it to be loosely coupled as much as possible.
Actually, this brings me the idea which I'll have to implement anyway,
to bind the ViewStack object's selectedIndex to the model using a
local helper function to get the selectedIndex, null checking the
model for the config file, and eventually returning an index.
This is not perfect but more elegant I think, yet I'd like to adapt
best practices dealing with such issues so feel about it :)

I almost forgot, my second drawback from the curly braces metjod is
the dispatching of redundant event, which is the reason that causes
the null checking to be essential.


Thanks and best regards,

Almog Kurtser.

--- In [email protected], "Uber_Nick" <[EMAIL PROTECTED]> wrote:
>
> Almong,
> 
> I don't see any problem with #5.  The getTabsLabels() should contain a
> simple null check, so it will only perform an action when your
> serviceList object is populated.
> 
> Client-side manipulation of the serviceList object should take place
> within the result method of the command retrieving the list.
> 
> I'm not sure what you mean when you state "but it shouldn't be there
> as it won't be readable".  Can you clarify your concerns with this
> approach?
> 
> -Nick Matelli
> Amentra, Inc
> 
> --- In [email protected], "mydarkspoon" <mydarkspoon@> wrote:
> >
> > Hello all,
> > 
> > I'm new with Cairngorm, trying to develop a wizard RIA with flex, and
> > I encountered an issue with data binding that went ugly:
> > In my model I have an XML doc taht describes several available search
> > services from the server. This XML is retrieved when the app start by
> > using an appropriate command that uses business delegate.
> > 
> > However, in the view I have a TabBar, that needs to manipulate the XML
> > config file from the model, meaning that it has to know when this xml
> > is retrieved.
> > I found few approaches to this:
> > 
> > 1. use a fake getter-setter binded to the model. My drawback from this
> > approach is quite obvious, I don't really need a getter here, but a
> > notification...
> > 2. custom [Bindable(event="....")]. This also not the best way as it
> > introduces new complexity to the model and enforces the developer to
> > dispatch an event...
> > 
> > 3. Using a command to create the data for the TabBar in the view. I
> > think this creates a tightly coupled connection between the controller
> > and the view...
> > 
> > 4. Using Paul Williams <ac:ObserveValue /> util. Although one might
> > think this creates a slick binding to function by hiding the fake
> > getter-setter, it actually dispatches redundant events because it
> > handler can't be compared to the source property, and thus the handler
> > is being called even when the source is null.
> > 
> > 5. using curly braces:
> > <mx:TabBar dataProvider={getTabsLabels(_model.servicesList)} />
> > This approach also introduces redundant events as its destination is
> > not read-write enabled and it will get dispatched even when the
> > servicesList is null.
> > Moreover, I want to executes one more manipulation on the xml from the
> > model, it can be created while calling the getTabsLabels() but it
> > shouldn't be there as it won't be readable...
> > 
> > 
> > I'll be more than happy to hear your ideas.
> > 
> > Thanks a lot !
> > 
> > Almog Kurtser.
> >
>


Reply via email to