[flexcoders] value object binding problem
I have this VO binding from java to as3: JAVA / JDK6 - LookupStuff.java public class LookupStuff { private ListClassA attributeA; private ListClassA attributeB; private MapString, ListClassB attribute1; private MapString, ListClassC attribute2; private MapString, ListClassD attribute3; ...setter/getters... } - AS3 - LookupStuff.as [RemoteClass(alias=my.java.package.LookupStuff)] import mx.collections.ArrayCollection; [Bindable] public class LookupData { public var attributeA:ArrayCollection; public var attributeB:ArrayCollection; public var attribute1:ArrayCollection; public var attribute2:ArrayCollection; public var attribute3:ArrayCollection; } -- private function myHandler(event:ResultEvent):void { var lookup:LookupStuff = event.result as LookupStuff; // lookup is null! why??? } Im getting null when my actionscript handler (thru RemoteObject / ResultEvent) finally gets event.result. Anybody knows why? Can a Map and List interfaces easily maps to an AS3 ArrayCollection? I've verified that my java code is returning a good return value (not null). - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
RES: [flexcoders] value object binding problem
You MUST import the classes used into the ArrayCollection. Or, you may use the ArrayElementType, for the auto-import at the compiler time. public class LookupData { [ArrayElementType(package.ClassA)] public var attributeA:ArrayCollection; [ArrayElementType(package.ClassB)] public var attributeB:ArrayCollection; [ArrayElementType(package.ClassB)] public var attribute1:ArrayCollection; [ArrayElementType(package.ClassC)] public var attribute2:ArrayCollection; [ArrayElementType(package.ClassD)] public var attribute3:ArrayCollection; } De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de ibo Enviada em: quinta-feira, 8 de maio de 2008 14:51 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] value object binding problem I have this VO binding from java to as3: JAVA / JDK6 - LookupStuff.java public class LookupStuff { private ListClassA attributeA; private ListClassA attributeB; private MapString, ListClassB attribute1; private MapString, ListClassC attribute2; private MapString, ListClassD attribute3; ...setter/getters... } - AS3 - LookupStuff.as [RemoteClass(alias=my.java.package.LookupStuff)] import mx.collections.ArrayCollection; [Bindable] nbs p; public class LookupData { public var attributeA:ArrayCollection; public var attributeB:ArrayCollection; public var attribute1:ArrayCollection; public var attribute2:ArrayCollection; public var attribute3:ArrayCollection; } -- private function myHandler(event:ResultEvent):void { var lookup:LookupStuff = event.result as LookupStuff; // lookup is null! why??? } Im getting null when my actionscript handler (thru RemoteObject / ResultEvent) finally gets event.result. Anybody knows why? Can a Map and List interfaces easily maps to an AS3 ArrayCollection? I've verified that my java code is returning a good return value (not null). Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i6 2sR8HDtDypao8Wcj9tAcJ
Re: RES: [flexcoders] value object binding problem
Luciano, Thanks it worked for ListClassX but not for MapString, ListClassB. How do we convert this map to AS3? Luciano Manerich Junior [EMAIL PROTECTED] wrote: You MUST import the classes used into the ArrayCollection. Or, you may use the ArrayElementType, for the auto-import at the compiler time. public class LookupData { [ArrayElementType(package.ClassA)] public var attributeA:ArrayCollection; [ArrayElementType(package.ClassB)] public var attributeB:ArrayCollection; [ArrayElementType(package.ClassB)] public var attribute1:ArrayCollection; [ArrayElementType(package.ClassC)] public var attribute2:ArrayCollection; [ArrayElementType(package.ClassD)] public var attribute3:ArrayCollection; } - De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de ibo Enviada em: quinta-feira, 8 de maio de 2008 14:51 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] value object binding problem I have this VO binding from java to as3: JAVA / JDK6 - LookupStuff.java public class LookupStuff { private ListClassA attributeA; private ListClassA attributeB; private MapString, ListClassB attribute1; private MapString, ListClassC attribute2; private MapString, ListClassD attribute3; ...setter/getters... } - AS3 - LookupStuff.as [RemoteClass(alias=my.java.package.LookupStuff)] import mx.collections.ArrayCollection; [Bindable] nbs p;public class LookupData { public var attributeA:ArrayCollection; public var attributeB:ArrayCollection; public var attribute1:ArrayCollection; public var attribute2:ArrayCollection; public var attribute3:ArrayCollection; } -- private function myHandler(event:ResultEvent):void { var lookup:LookupStuff = event.result as LookupStuff; // lookup is null! why??? } Im getting null when my actionscript handler (thru RemoteObject / ResultEvent) finally gets event.result. Anybody knows why? Can a Map and List interfaces easily maps to an AS3 ArrayCollection? I've verified that my java code is returning a good return value (not null). - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
RES: RES: [flexcoders] value object binding problem
Hey ibo, A map can not be converted to an ArrayCollection ( http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp. htm?context=LiveDocs_Partsfile=1103.html ) A map will be converted to an Generic Object, and the key will be a property: public class LookupData { [ArrayElementType(package.ClassA)] public var attributeA:ArrayCollection; [ArrayElementType(package.ClassB)] public var attributeB:ArrayCollection; public var attribute1:Object; public var attribute2:Object; public var attribute3:Object; } You may access those properties with attribute1.key1, attribute1.key2, attribute1.anotherKey, ... And in that case, remember to import the value classes. De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de ibo Enviada em: quinta-feira, 8 de maio de 2008 17:03 Para: flexcoders@yahoogroups.com Assunto: Re: RES: [flexcoders] value object binding problem Luciano, Thanks it worked for ListClassX but not for MapString, ListClassB. How do we convert this map to AS3? Luciano Manerich Junior [EMAIL PROTECTED] wrote: You MUST import the classes used into the ArrayCollection. Or, you may use the ArrayElementType, for the auto-import at the compiler time. public class LookupData { [ArrayElementType(package.ClassA)] public var attributeA:ArrayCollection; [ArrayElementType(package.ClassB)] public var attributeB:ArrayCollection; [ArrayElementType(package.ClassB) ] public var attribute1:ArrayCollection; [ArrayElementType(package.ClassC)] public var attribute2:ArrayCollection; [ArrayElementType(package.ClassD)] public var attribute3:ArrayCollection; } De: flexcoders@yahoogroups.com [ mailto:[EMAIL PROTECTED] Em nome de ibo Enviada em: quinta-feira, 8 de maio de 2008 14:51 Para: flexcoders@yahoogroups.com Assunto: [flexcoders] value object binding problem I have this VO binding from java to as3: JAVA / JDK6 - LookupStuff.java public class LookupStuff { private ListClassA attributeA; private ListClassA attributeB; private MapString, ListClassB attribute1; private MapString, ListClassC attribute2; private MapString, ListClassD attribute3; ...setter/getters... } - AS3 - LookupStuff.as [RemoteClass(alias=my.java.package.LookupStuff)] import mx.collections.ArrayCollection; [Bindable] nbs p; public class LookupData { public var attributeA:ArrayCollection; public var attributeB:ArrayCollection; public var attribute1:ArrayCollection; public var attribute2:ArrayCollection; public var attribute3:ArrayCollection; } -- private function myHandler(event:ResultEvent):void { var lookup:LookupStuff = event.result as LookupStuff; // lookup is null! why??? } Im getting null when my actionscript handler (thru RemoteObject / ResultEvent) finally gets event.result. Anybody knows why? Can a Map and List interfaces easily maps to an AS3 ArrayCollection? I've verified that my java code is returning a good return value (not null). Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i6 2sR8HDtDypao8Wcj9tAcJ%20 Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i6 2sR8HDtDypao8Wcj9tAcJ