The parentApplication property is a reference to the Application
object (the nesting refers to applications loaded within other
applications with the Loader control and probably doesn't apply to
your case), but it's a property of mx.core.UIObject, which your
SDMDelegate obviously isn't extending and probably shouldn't.  Have
you tried dumping mx.core.Application.application.myServices in the
delegate constructor to see if it exists at that point?  You could
also try adding a creationComplete event to the application to
determine exactly when the siteDataServices remote object is
available; something like
creationComplete="Dumper.dump(myServices.siteDataServices)" should do it.

It might be your best bet to pass the service to your delegate
constructor as a parameter.


--- In flexcoders@yahoogroups.com, "Geoffrey" <[EMAIL PROTECTED]> wrote:
>
> Hmm....
> 
> I replaced the service assignment with:
> "this.service = parentApplication.myServices.siteDataServices;"
> 
> But I get the following error:
> "There is no property with the name 'parentApplication'."
> 
> Looking at the docs, parentApplication looks like it's intended to 
> walk up the tree of multiple application nested within themselves.  I 
> don't think that applys to this case since I only have 1 mxml file 
> with the <mx:Application> tag.  Please correct me if I've 
> misunderstood this.
> 
> Thanks,
> Geoff
> 
> 
> --- In flexcoders@yahoogroups.com, "Doug Lowder" <douglowder@> 
> wrote:
> >
> > My guess would be that SDMDelegate's constructor can't access your
> > siteDataServices RemoteObject through 
> mx.core.Application.application.
> >  Try "this.service = parentApplication.myServices.siteDataServices"
> > instead, or pass the service as a parameter to the constructor as 
> you
> > do with the responder.
> > 
> > Doug
> > 
> > --- In flexcoders@yahoogroups.com, "Geoffrey" <gtb104@> wrote:
> > >
> > > I've been trying for the last few days to get RemoteObject to 
> work, 
> > > but with little luck.  I've searched this site, and have tried to 
> > > implement the examples found in "developing rich clients with 
> > > macromedia FLEX".  To make matters more confusing, I've also 
> tried to 
> > > implement the command/control/delegate patterns that the above 
> book 
> > > advocates.
> > > 
> > > Basically, I think the problem is that I'm not "seeing" the Java 
> > > classes I've created.  Below are code snippets of (what I think) 
> are 
> > > the relevant files.
> > > 
> > > ### My Java classes ###
> > > {TOMCAT-HOME}\webapps\flex\WEB-
> > > INF\classes\com\foo\test\business\SiteMaintenanceDelegate.class
> > >   package com.foo.test.business;
> > >   import com.foo.test.vo.SiteKeywordVO;
> > >   public class SiteMaintenanceDelegate {
> > >   public SiteMaintenanceDelegate() {
> > >   }
> > >   public SiteKeywordVO reviewKeywords() {
> > >           SiteKeywordVO keywords = new SiteKeywordVO();
> > >           return keywords;
> > >   }
> > >   }
> > > 
> > > {TOMCAT-HOME}\webapps\flex\WEB-
> > > INF\classes\com\foo\test\vo\SiteKeywordVO.class
> > >   package com.foo.test.vo;
> > >   import java.io.Serializable;
> > >   public class SiteKeywordVO implements Serializable {
> > >     public String[] keywords;
> > >   public void SiteKeywordVO() {
> > >         String[] keywords = {"first agr", "second agr", "third 
> agr"};
> > >   }
> > >   }
> > > 
> > > ### My RO definition  ###
> > > {TOMCAT-HOME}\webapps\flex\services\Services.mxml
> > >   <mx:RemoteObject id="siteDataServices"          
> > >   source="com.foo.test.business.SiteMaintenanceDelegate"
> > >   result="event.call.resultHandler(event)"
> > >   fault="event.call.faultHandler(event)"
> > >   showBusyCursor="true">
> > >         <mx:method name="reviewKeywords"/>
> > >   </mx:RemoteObject>
> > > 
> > > ### My ActionScript VO ###
> > > {TOMCAT-HOME}\webapps\flex\sdm\com\foo\test\vo\SiteKeywordVO.as
> > >   class com.foo.test.vo.SiteKeywordVO {
> > >   public var keywords:Array;
> > >   public var _remoteClass;
> > >   public function SiteKeywordVO() {
> > >        _remoteClass="com.foo.test.vo.SiteKeywordVO";
> > >   }
> > >   }
> > > 
> > > ### My testing mxml file ###
> > > {TOMCAT-HOME}\webapps\flex\sdm\sdmUnitTest.mxml
> > >  <?xml version="1.0" encoding="utf-8"?>
> > >  <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
> > >   xmlns:sdm="sdm.*"
> > >   xmlns:services="services.*"
> > >   <sdm:SiteDataMaint/>
> > >   <services:Services id="myServices"/>
> > > </mx:Application>
> > > 
> > > ### My SiteDataMaint component ###
> > > {TOMCAT-HOME}\webapps\flex\sdm\SiteDataMaint.mxml
> > >   ... //just the script part
> > >   <mx:Script>
> > >   <![CDATA[
> > >   import sdm.business.*;
> > >   import sdm.commands.*;
> > >   import sdm.control.*;
> > >   import com.foo.test.vo.*;
> > >   import mx.controls.Alert;
> > >   public function initApp() {
> > >        var controller = new SDMController;
> > >   }
> > >   ]]>
> > >   </mx:Script>
> > >   ...
> > > 
> > > The SDMController class seems to be working correctly.
> > > 
> > > ### My Delegate class ###
> > > {TOMCAT-HOME}\webapps\flex\sdm\business\SDMDelegate.as
> > >   ... //just the constructor
> > >   public function SDMDelegate(responder:Responder) {
> > >   this.service = 
> > > mx.core.Application.application.myServices.siteDataServices;
> > >   Dumper.dump(service);
> > >   this.responder = responder;
> > >   }
> > > 
> > > I think this is where the problem is.  When I dump 'service' (via 
> > > Flex Trace Panel), I get 'undefined'.
> > > 
> > > I really have no idea where to go from here.  I've tried turning 
> on 
> > > all debug stuff, used NetConnectionDebugger, use Flex Trace 
> Panel... 
> > > nothing on all accounts.
> > > 
> > > Thanks for any suggestions you may have!
> > > Geoff
> > >
> >
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to