Easier, but I would not wait too long to start using an event model.

 

In response to your other question, forget my re-dispatch suggestion.  Use a
data model or call the function directly.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Scott
Sent: Monday, March 23, 2009 2:33 PM
To: flexcoders@yahoogroups.com
Subject: RE:[flexcoders] Re: watching and triggering events

 

DOH. Ok, that is a LOT easier than what I was trying to do!  I think it's
time for a break. =O

 

Thanks!

 

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Tim Hoff
Sent: Monday, March 23, 2009 1:39 PM
To: flexcoders@yahoogroups.com
Subject: {Disarmed} [flexcoders] Re: watching and triggering events

 


I agree with Tracy; using an MVC architecture handles this nicely. For
a simpler approach, make the method in ListAndShow public; and call it
from the parent; when the event is heard.

-TH

--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
"Tracy Spratt" <tspr...@...> wrote:
>
> Have the parent re-dispatch the event and listen for it in
"listAndshow"
>
>
>
> One way to handle issues like this it to have a central bindable data
model.
> A 'singleton" is often used for this. Any component anywhere in the
app
> that needs to react when some data value changes can listen to the
model,
> either by binding for simple values, or by using a changeWatcher if
some
> action needs to occur.
>
>
>
> The data service call result handler (which can be in the model) will
set
> the appropriate model property, and the child components will respond.
>
>
>
>
>
> Tracy Spratt,
>
> Lariat Services, development services available
>
> _____
>
> From: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com
[mailto:flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com]
On
> Behalf Of Scott
> Sent: Monday, March 23, 2009 12:29 PM
> To: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com
> Subject: [flexcoders] watching and triggering events
>
>
>
>
> I think I'm making this more difficult than it should be; or at least
I hope
> I am...
>
> I've got a parent viewer called AddContactandReminder.mxml and that
has two
> child objects, AddContact.mxml and ListAndShowContacts.mxml.
>
> When I add a new contact in the contact object I trigger an event
> evtAddedNewContact which is watched in the parent object and triggers
the
> AddContact window to close. I also want it to trigger the
> ListAndShowContacts.mxml to reload the contacts from the server and
display
> the new list. However, since it's another child object at the same
level as
> the AddContact.mxml I can't see the evtAddedNewContact fire.
>
> Is there an easy way to watch this event from ListAndShowContacts?
>
> Thanks!
>


-- 
This message has been scanned for viruses and 
dangerous content by  <http://www.mailscanner.info/> MailScanner, and is 
believed to be clean. 



Reply via email to