Such mappings can be useful when you are using a value object ie an object containing values.
AS class:
/*we mark a class we want to map with RemoteClass tag. alias is the exact location of the class*/
package valueObjects
{
[RemoteClass(alias="valueObjects.SampleVo")]
public class SampleVo{
public var val1:String = "val1";
public var num1:int = 1;
public function getServerVal(obj:SampleVo):SampleVo{
return new SampleVo();
}
}
}
Java class (you will have to configure it as a remote object):
package valueObjects;
public class SampleVo {
public String val1 = "val2";
public int num1 = 2;
public SampleVo getServerVal(SampleVo obj){
return new SampleVo();
}
}
If you have this, you can do this in flex while handling result on calling getServerVal function:
var vo:SampleVo = event.result as SampleVo;
resultTxt.text = vo.val1+vo.num1;
Becoming a Freelancer as a Finance Professional
5 years ago
No comments:
Post a Comment