Ideally your pase() method should be on the model, with the view only used to render passed data via databinding the parsed value from the model to the dataprovider of the view.

 

Regards,

 

Bjorn Schultheiss

Senior Flash Developer

QDC Technologies

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jamie O
Sent: Wednesday, 8 November 2006 9:57 AM
To: [email protected]
Subject: [flexcoders] Re: cairngorm: calling a function in a view

 

I believe Observe / Value is what I want to use for a current
challenge, but try as I might, I just cannot seem to wrap my head
around it. Hoping someone could take another kick at the cat to
explain it in context of the following situation:

My component (SWC) is defined inside a view and has a public property
that is databound to my modelLocator for it's XML source. When the
right data conditions are met internally it broadcasts an addressEvent
with all user selected data.
<pcall:pcall id="PointofCall" left="10" top="50"
postcodeXML="{ModelLocator.getInstance().PointOfCall.postcodeXML}"
AddressEvent="AddressEventHandler(event)" />

When the user provides input data, I broadcast a search event and
receive the updated XML from the services / delegator. There is a
public method - currently titled Update() - in the component to parse
the XML and build up it's display accordingly. Within the view I can
bind a button to that Update() function and the parsing goes smooth.

<mx:Button x="333" y="10" label="Button" click="{PointofCall.Update()}"/>

But the problem is that I only know when the data is updated in the
onResult method of my command that sent the data off in the first place.

How do I - in a command - trigger the method of a component on a view?

Thanks,
Jamie

--- In [email protected], "Tim Hoff" <[EMAIL PROTECTED]> wrote:
> > Hi Alex,
> >
> > Thank you very much for addressing this topic in your blog. Using
> > observe and ObserveValue seems much cleaner than
> > viewLocator/viewHelper; more direct and less classes. Your
> examples
> > illustrate a very useful technique for manipulating local view
> > states through binding. I wasn't however, able to view the source
> > for Iteration6. It shows a partial listing of the application mxml
> > class, but no other classes and download options.
> >
> > Kudos,
> > -TH

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to