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

Show Posts

| * |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Standard Version / Every view component can be linked to a Mediator? on: April 22, 2009, 05:48:51
Hi,

I have a problem with associating a Mediator to a specific component inside a view component (mxml).
I explain : in a Tabs.mxml component I have a TabNavigator containing 4 Panel, each one having a specific id. For one of these Panels components, let's say panel with id="testPanel", I want to link a specific Mediator : "TestTabMediator". I have registered TestTabMediator to the facade with the specific "testPanel". From "testPanel" I dispatch an Event and TestTabMediator is listenning for it and then calls his "test" method.
But when I dispatch the Event from Panel "testPanel", I never pass inside "test" method from TestTabMediator.
After many tests and questions, I tried to use the TabsMediator (linked to Tabs.mxml) instead of the TestTabMediator (linked to the Panel "testPanel") to listen for the Event. And this solution works.

So here is my question : has a Mediator to be linked only to custom mxml components and can not be linked to <mx:...> components?

I'm sorry I do not have the code near me, but I can post it later if needed.

Thank you for your answer.

Seb
2  PureMVC Manifold / Standard Version / Calling Proxy from Mediator... on: February 28, 2009, 04:56:07
Hi,

My question is quite simple : I want to call a Proxy directly from the Mediator to initialize a list of data for a Combobox. But is it possible to receive the result without waiting for the Notification thrown by the Proxy?
A kind of synchronous call like :
myList = myProxy.getSomeData();

If not, I will have to register the Mediator for the Notification, but in this case, do all the components that register this Notification receive that Notification even if they are not displayed? If I only want one Mediator to be informed of the result of the Proxy call, is it OK to use the Notification solution?

thanks for your help.

Sebastien
3  PureMVC Manifold / Standard Version / Error management from Java side control on: January 30, 2009, 07:45:13
Hi,

I'm quite new to Puremvc and Flex and I'm trying to use Flex with an existing Java framework that we already developped and used. This framework only deals with the model part = accessing to the database for CRUD operations or validating when the user fills forms (eg the user pseudo may be unique and things like that...).
To access the model, the framework has Service objects (like USerService) and it returns a ServiceResponse object that can contain a List of Object (simple POJO) if everything is OK, or a List of ServiceError objects if there was errors (not Exceptions). This ServiceError object contains the error message, the name of the property that has an error (in the case of filling a form for instance), and the severity of the error.
In the Flex side, I have a ServiceResponse.as and a ServiceError.as classes linked to the ServiceResponse.java and the ServiceError.java.
What I would like to do, is linking the error message contained in the ServiceError object to the property in error and displaying errors like Flex Validators do this = the form input in error in a red square and a tooltip with the error message for example.
I was thinking to inspect the ServiceResponse to determine if errors exist and in this case to dispatch a ValidationResultEvent containing ValidationResult objects with the properties of my ServiceError objects. I think this could link the errors to the right property in error?
But.... with Puremvc where can/may I dispatch Events to the view part to imitate the Validator behavior?

As I'm quite new to Flex/Puremvc, I'm maybe completely wrong... Maybe there is another cleaner solution?

Thanks for your help and sorry for the long post!

Sebastien
Pages: [1]