1
votes

Good PM stackoverflow...I'm having problem in Flex. Apparently I am experiencing a can't find managedQuery or ManagedOperation named:getStudentprofile error

As I researched in some forums, I learned that the one causing this error is that I have duplicate instances of my data services in other components...So my question is how can I share my data services to other components? I don't have an idea how...please help me

These are the declarations that I need to share to other components:

parentinfoservice:ParentinfoService id="parentinfoService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/

studentprofileservice:StudentprofileService id="studentprofileService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/
1
Are you getting an error? At runtime? Or at compile time? Can you please show some code? - JeffryHouser
I am getting a run time error. ok ill edit the post - wawaragna
Much better; but which line of code is causing the error? Have you run in debug mode? - JeffryHouser

1 Answers

0
votes

To answer the question in the text, the best way to 'share' data services across the application is to use a framework intended for this. There are quite a few available, such as Cairngorm, Parsley, Swiz, PureMVC, and the one I suggest: Mate

Here is a very simple example that uses a RemoteObject service implementation: http://mate.asfusion.com/page/examples/stock-quotes

There are many other examples and good documentation. Investing time in learning a framework, no matter what it is, is time well spent, and will greatly speed up the rest of your development time, especially debugging, refactoring and maintenance. There's no 'right' framework, they all have their niche. I recommend Mate because it has a large community and good documentation and examples...