Hi,

I have a small application. A single view is declared in the main *mxml *file.
This view loads some [remote] data upon initialisation.

I  rejigged the application so that it loads in a config file first (this
config file contains the url from which I should load the data). Initially
the config file didn't finish loading in until after my view's *
initialization* event had fired .. so the view attempted to load data but
threw an error.

To solve this I plumped for declaring my view in MXML, but changing its
creationPolicy to "none", then calling createComponentsFromDescriptors()
once my config had loaded. It works fine. I also realise there are various
other ways to solve this (e.g. I could call my view's init() method
manually, or I could add the view using ActionScript .... both being done
after the config file had loaded).

I wanted to post because I'm curious to find out how other people have been
handling situations like this, and what arguments for/against your own
methods you have become aware of (mainly because I think it could make a
really useful blog post). So if you can spare a moment, I would appreciate
the feedback. For example, do you feel that it's unacceptable to make data
requests from within a View, even in a small app, and if so what would you
change? All that kind of stuff is useful :)

Cheers,
Neil

p.s. I haven't really run in to this before because I usually don't make
data calls from inside views (but rather in Commands). As this is a small
application I wonder if setting up a FrontController would be overkill
though.

Reply via email to