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 / Re: Calling Proxy from Mediator... on: March 01, 2009, 02:01:21
OK, I suppose you're talking about DeptEnum from UserVO? I think I understand the use of Enum, but how do I initialize the list of countries from database in the CountryEnum class? Can this class register to be informed for Notifications? Please can you explain me?
3  PureMVC Manifold / Standard Version / Re: Calling Proxy from Mediator... on: March 01, 2009, 12:43:54
Thanks for your answer.
Yes, the proxy reads a list of countries in a database throught Java RemoteObject call. So, I understand that I have to use a Notification... no other solution?
And, the next question : in case of a modification of the countries returned (for another continent for example), will all the components registered with the Notification be modified by the new list of countries returned? And if I don't want this, how can I do?

Sebastien
4  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
5  PureMVC Manifold / Standard Version / Re: Error management from Java side control on: February 04, 2009, 03:25:01
OK, I have it! the correct syntax is :

TextInput(creationCompteUtilisateurView[err.propertyName]).errorString = err.errorMessage

and it works great!

Thanks for your help Cliff
6  PureMVC Manifold / Standard Version / Re: Error management from Java side control on: February 04, 2009, 01:02:02
Thanks Cliff,

I'm sorry but it seems it doesn't work...
I tried :
TextInput(creationCompteUtilisateurView.[err.propertyName]).errorString = err.errorMessage;
and :
UIComponent(creationCompteUtilisateurView.[err.propertyName]).errorString = err.errorMessage;

and I got compilation errors : something like "syntax error : identifier missing before leftbraket" (it's in french...) and "syntax error : rightparen missing before rightbrace"

Any idea?

Sebastien
7  PureMVC Manifold / Standard Version / Re: Error management from Java side control on: February 03, 2009, 03:18:21
Thanks a lot Cliff

After trying a few possibilities a tried your solution and it's OK. But...
In the ServiceError object there are 2 interesting properties : "propertyName" and "errorMessage". What I'm now trying to do is to set the errorMessage of the TextInput that failed validation with the errorMessage of the ServiceError using the propertyName like this (inside the Mediator) :

case ApplicationFacade.USER_CREATE_FAILURE_NOTIFICATION:
   var errors:ArrayCollection = userBusinessProxy.errors;
   for (var i:int=0; i<errors.length; i++) {
      var err:ServiceError = errors;
      creationCompteUtilisateurView.(err.propertyName).errorString =                                            err.errorMessage;
   }
        break;

"creationCompteUtilisateurView" is the view component associated with this Mediator.

The red part of code doesn't work... there are no errors at compilation, but during execution I got "TypeError: Error #1123: Filter Operator not supported on type fr.gogaya.view.components.CreationCompteUtilisateur."

Is it just possible to do this? Accessing to a property of an Object from the name of this property that is given by the value of another object property?
If not, how can I do this?

Thanks for your help!

Sebastien
8  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]