Why wouldn't a flex remoteobject be able to work within a custom component?

Posted by Gary on Stack Overflow See other posts from Stack Overflow or by Gary
Published on 2010-03-31T18:57:10Z Indexed on 2010/04/01 1:53 UTC
Read the original article Hit count: 432

Filed under:
|
|
|
|

Please enlighten this flex noob. I have a remoteobject within my main.mxml. I can call a function on the service from an init() function on my main.mxml, and my java debugger triggers a breakpoint. When I move the remoteobject declaration and function call into a custom component (that is declared within main.mxml), the remote function on java-side no longer gets called, no breakpoints triggered, no errors, silence.

How could this be? No spelling errors, or anything like that. What can I do to figure it out?

mxml code:

< mx:RemoteObject id="myService" destination="remoteService" endpoint="$(Application.application.home}/messagebroker/amf" > < /mx:RemoteObject >

function call is just 'myService.getlist();'

when I move it to a custom component, I import mx.core.Application; so the compiler doesn't yell

my child component: child.mxml

<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" >
    <mx:Script>
        <![CDATA[
            import mx.core.Application;
            public function init():void {
                helloWorld.sayHello();
            }
        ]]>
    </mx:Script>

    <mx:RemoteObject id="helloWorld" destination="helloService" endpoint="$(Application.application.home}/messagebroker/amf" />

    <mx:Label text="{helloWorld.sayHello.lastResult}" />
</mx:Panel>

my main.mxml:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" xmlns:test="main.flex.*" >
    <mx:Script>
        <![CDATA[
            [Bindable]
            public var home:String;
            [Bindable]
            public var uName:String;
            public function init():void {
                //passed in by wrapper html
                home = Application.application.parameters.appHome;
                uName = Application.application.parameters.uName;
            }
        ]]>
    </mx:Script>
    <test:child />
</mx:Application>

© Stack Overflow or respective owner

Related posts about flex

Related posts about java-ee