Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Fake binding  (Read 6351 times)
micromoth
Newbie
*
Posts: 3


View Profile Email
« on: January 30, 2009, 10:19:14 »

Hi,

As PureMVC does not use Binding as Cairngorm does, how can I fake it to appear as though a form is bound to a display. What I want to do is update a display panel as the user types a name into a form on the same page.

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: January 30, 2009, 10:43:22 »

Check out the Flex Employee Admin demo. In short, shuttle a VO to the view component via its Mediator, then inside the component, bind to the locally-held VO reference.

-=Cliff>
Logged
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« Reply #2 on: January 30, 2009, 09:00:24 »

Check out the Flex Employee Admin demo. In short, shuttle a VO to the view component via its Mediator, then inside the component, bind to the locally-held VO reference.

-=Cliff>

Would you frown on binding a property (which is bound to form controls or a list or whatever) of a component to a proxy object's data? I've been going back and forth with this.
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: January 31, 2009, 06:54:09 »

That VO reference could be the data object of a Proxy. But putting any ref to the proxy into the binding statement is bad. We don't want any coupling between the view compnents and the PureMVC apparatus. In that case you would be making edits directly to the Proxy's data without its knowledge, which means the Proxy can't alert the rest of the app of the changes.

Sometimes that's just fine. But sometimes its not what you want. In which case you probably want to clone the VO and poke the clone into the view component from the mediator, then listen for an event from the view component that says 'hey, I've got modified data here. Then tak the Vo from the view component and poke it back into the porxy by calling a proxy method like 'update()', which stores the new data (possibly calling a service, or just setting its data property) and sends a SomethingProxy.UPDATED do the rest of the app is aware of the update.

-=Cliff> 
Logged
Pages: [1]
Print