Hey,
I'm getting pretty comfortable using Cairngorm, but known that
I'm
still only scratching the surface of Flex 2. But I've run into
two
separate issues that I think are really the same. I think the
common
question I'm asking is how do you prevent updates from displaying
to
the screen until all results / data are loaded?
Scenario #1:
-In
the creationComplete event of my main .mxml file I call a function
which
broadcasts an event - evalURLEvent.
-Depending on a number of data
variables, the command will direct the
user to a given view by updating a
specific variable in the model -
appState - which my viewStack has as it's
data provider.
-In most cases of that evalURLEvent command, I do a number
of service
calls and only change the appState in the appropriate onResult
function.
-The problem is that because the event is a separate process,
the app
appears to load and then drops in data / presentation which
looks
fugly. I've hunted a bit on preloaders, but can't seem to find
a
sufficient example to display the preloader in all cases and remove
it
within my result function (once I know the data is back).
Scenario
#2:
-I have a single event type - NavigateEvent - which I broadcast in
a
number of view event handlers when I want to change the view
(by
changing the appState variable in the command.
-When my user
attempts to login, I broadcast this event along with the
user / pass for
validation (currently stubbed for a service call).
-When the login
returns valid, I want to send the user to an inbox
screen where they will get
a list of messages.
-The same issue comes up as the initial load. On
receipt of the
validation of the login call, I would send out requests for
their
message data, contacts, etc. I only want to upload the view to
the
inbox once I have all that data.
I'm using the busy cursor on the
service calls for now, but I'm
certain there must be better logic to consider
for these types of
issues. If someone can point me down the path to
enlightenment, it
would greatly be
appreciated.
Thx,
Jamie
P.S. I think this is a general enough
issue, and the code would have
to come from such a variety of spots in my
app, that I didn't think
including my sample code would help. If you can
provide a response I'm
pretty confident I can 'cairngormalize' it to my
needs.
|
AVIS
IMPORTANT
|
WARNING
|
|
Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur.
|
This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e-mail in error, please notify the sender.
|