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: Proxy and data Bindable  (Read 3056 times)
jfdesgagne
Newbie
*
Posts: 3


View Profile Email
« on: February 11, 2009, 02:21:23 »

Hi. I have a problem with PureMVC and data bindable.

I register a proxy who load text on 2 differents resources. It have a public bindable function in the Proxy class who call the getString bindable function of ResourceManager. My function is bindable on the "change" event, same as the getString function in the ResourceManager.   [Bindable("change")]

Normaly in each mxml, there are a reference of the ResourceManager ... so I can easy use bindable data like {resourceManager.getString("en_US", "myKey")}

But if i want to use the bindable function in the proxy, it does'nt work ... i presume its because it's a static reference of a bindable function ...
{LocaleProxy.getInstance().getString("en_US", "myKey")}

Anyone have a clue because i'm lost !

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



View Profile WWW Email
« Reply #1 on: February 12, 2009, 07:58:56 »

Bindable isn't working on your proxy methods because Proxy isn't an EventDispatcher subclass. Proxies communicate changes to the rest of the system by Notification, not Events. We are trying to separate the model from the view, so rather than binding a view component directly to a Proxy to get updates, we have Mediators which respond to the notifications sent by the proxy and update the view accordingly.

The Proxy recieves updates from the view via mediators listening to the view components events, then sending the changed data in a notification picke d up by a command that modifies the model, or the mediator may do simple updates directly to the model on behalf of the view component.

The process is essentially the same as what happens under the hood with Flex binding, except, being built into the framework, it is portable to places where Flex binding isn't available, such as flash.

-=Cliff>
Logged
Pages: [1]
Print