I tried to dump myServices via:
<code>Dumper.dump(mx.core.Application.application.myServices);</code> 
during the Delegate constructor, and it came up 'undefined'.

I tried a creationComplete and an Initialize event to dump 
siteDataServices upon startup of the main mxml file.  Both had this 
to say:

[INFO]: (Object)
         log: (Object)
          level: 1 (Number)
          name: RemoteObject_AMF (String)
         __conn: (Object)
          contentType: application/x-fcs (String)
          _headerAdded: false (Boolean)
          _config: (Object)
           m_debug: true (Boolean)
           app_server: (Object)
            coldfusion: true (Boolean)
            amfheaders: false (Boolean)
            amf: false (Boolean)
            httpheaders: false (Boolean)
            recordset: true (Boolean)
            error: true (Boolean)
            trace: true (Boolean)
            _debug: true (Boolean)
           realtime_server: (Object)
            trace: true (Boolean)
            _debug: true (Boolean)
           client: (Object)
            rtmp: true (Boolean)
            http: true (Boolean)
            recordset: true (Boolean)
            trace: true (Boolean)
            _debug: true (Boolean)
           _debug: true (Boolean)
          _protocol: http (String)
          _id: 0 (Number)
          netDebugProxyFunctions: true (Boolean)
         _allowRes: true (Boolean)
         __serviceName: com.foo.test.business.SiteMaintenanceDelegate 
(String)
         __responder: (Object)
          __obj: undefined (undefined)
          __onFault: _resp5_fault (String)
          __onResult: _resp5_result (String)
         __name: siteDataServices (String)
         __showBusyCursor: true (Boolean)
         __concurrency: 0 (Number)
         __parentDocument: undefined (undefined)

Looks like it's available at both initialization and creationComplete 
time frames.

I'm curious why the examples taken from the books website would prove 
to be this difficult to implement.

When you say "pass the service to your delegate constructor as a 
parameter", do you mean as a string?  Like the following:

  public function ReviewKeywordsCommand() {
        this.delegate = new SDMDelegate( this, mx.core.Application.\
                        application.myServices.siteDataServices );
  }


sorry if these are really basic questions, but I'm new to RIA 
development.

Thanks,
Geoff


--- In flexcoders@yahoogroups.com, "Doug Lowder" <[EMAIL PROTECTED]> 
wrote:
>
> 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" <gtb104@> 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