Hello, I have a problem. If I'm getting null from myRo.getGetMyObj.lastResult
in function onLoad(),.. but it returns value in here:
<mx:TextInput id="txt2" text="{myRo.getGetMyObj.lastResult.otherProp}"/>
But when I'm sending the object back to the server everything is fine.
This works fine, I'm getting right values in server from Java Object:
myRo.setGetMyObj(mm);
But the same Java Object cannot be cast to the MyTestObject.as
In other words: I'm able to submit from my MyTestObject.as to
MyTestObject.java, but not vice verse. But i'm getting result from
MyTestObject.java though, but only here: <mx:TextInput id="txt2"
text="{myRo.getGetMyObj.lastResult.otherProp}"/>, this doesn't work (returns
null always): mm1=MyTestObject(myRo.getGetMyObj.lastResult);
Does somebody know why? Maybe it shouldn't work at all this way?
Thank you
PS: here is mxml I use:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
creationComplete="onLoad();">
<MyTestObject id="mm" myProp="{txt1.text}" otherProp="{Number(txt2.text)}"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
[Bindable]
private var mm1:MyTestObject;
private function onLoad():void{
myRo.getGetMyObj();
mm1=MyTestObject(myRo.getGetMyObj.lastResult);
}
private function clickHandler():void {
myRo.setGetMyObj(mm);
}
]]>
</mx:Script>
<mx:RemoteObject id="myRo" destination="myObject" showBusyCursor="true"/>
<mx:Form id="frm" defaultButton="{sbmt}">
<mx:FormItem label="Data 1">
<mx:TextArea id="txt1" text="{mm1.myProp}"/>
</mx:FormItem>
<mx:FormItem label="Data 2">
<mx:TextInput id="txt2"
text="{myRo.getGetMyObj.lastResult.otherProp}"/>
</mx:FormItem>
<mx:FormItem>
<mx:Button id="sbmt" label="Button" click="clickHandler();"
width="100%" height="100%"/>
</mx:FormItem>
</mx:Form>
</mx:Application>