OK、複雑なオブジェクトを .NET ライブラリから Flex アプリケーションに WebOrb 経由で渡しています。自動翻訳するために、[RemoteClass] メタデータ タグを次のように使用しています。
[RemoteClass(alias="test.PlanVO")]
public class Plan
{
[SyncId]
public var id:int;
public var Name:String;
}
Plan クラスを拡張して複雑な項目の配列を含めようとするまでは、これはまったく問題なく機能します。
。ネット:
public class PlanVO
{
public int id { get; set; }
public string Name { get; set; }
public List<PlanElementVO> children { get; set; }
}
public class PlanElementVO
{
public string elementName { get; set; }
}
アクションスクリプト:
[RemoteClass(alias="test.PlanVO")]
public class Plan
{
[SyncId]
public var id:int;
public var Name:String;
public var children:ArrayCollection;
}
[RemoteClass(alias="test.PlanElementVO")]
public class PlanElement
{
public var elementName:String;
}
この場合、子が .NET ライブラリによって返される場合でも、ActionScript Plan クラスの children プロパティは null です。
children フィールドを次のようなプロパティに変更しようとしました:
private var _children:ArrayCollection;
public function get children():ArrayCollection
{
return _children;
}
public function set children(o:*):void
{
if(o is ArrayCollection)
_children = o;
else if(o is Array)
_children = new ArrayCollection(o);
else
_children = null;
}
しかし、set 関数が呼び出されることはありません。
この方法で子供たちを Flex アプリに入れるにはどうすればよいですか?
ありがとう!