You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a method: https://paste.apache.org/jy56s
We are calling it as : shmUtil.setForm(arrFormItems, voCompany as Object,
org.apache.royale.reflection.describeType(shmCompanySetupVO) as XML);
We have tried it using TypeDefinition Instead of XML.
When we have changed XML to TypeDefinition in method setForm(...aValueObjInfo:TypeDefinition){.....
for each (var val:TypeDefinition in aValueObjInfo..variable)
...}
I got a compile time Error as ..variable property not exist in TypeDefinition:
Access of possibly undefined property variable through a reference with static type TypeDefinition.
[java]
[java] for each (var val:TypeDefinition in aValueObjInfo..variable)
Kindly Help us to Port this method. As we are using this method in our whole Application in every file.
Thanks in Advance
The text was updated successfully, but these errors were encountered:
Alex is correct (this will let you loop through the public instance variable definitions).
But you will also need to make more changes inside the loop.
(assuming 'val' is a VariableDefinition in all below):
wherever you have name comparisons it should be without the '@'
instead of:
if((aFormItems[k].id == val.@name)
it should be:
if((aFormItems[k].id == val.name)
And you need to change any reflection based getting and setting...
you need:
aFormItems[k].text = val.getValue(aValuObject);
Generally for getting or setting values it should be like:
var instanceVal:* = val.getValue(instance);
val.setValue(instance, valueToBeSet)
You should use the above approach instead of using instance[val.name]. (where val.name is the name of the variable in the original actionscript, and is the same value as for name in XML attribute)
The getValue/setValue approaches are important if you want to use reflection for manipulating public vars correctly in js-release build (because they are likely to be renamed by google closure compiler)
We have a method:
https://paste.apache.org/jy56s
We are calling it as : shmUtil.setForm(arrFormItems, voCompany as Object,
org.apache.royale.reflection.describeType(shmCompanySetupVO) as XML);
We have tried it using TypeDefinition Instead of XML.
When we have changed XML to TypeDefinition in method setForm(...aValueObjInfo:TypeDefinition){.....
for each (var val:TypeDefinition in aValueObjInfo..variable)
...}
I got a compile time Error as ..variable property not exist in TypeDefinition:
Access of possibly undefined property variable through a reference with static type TypeDefinition.
[java]
[java] for each (var val:TypeDefinition in aValueObjInfo..variable)
Kindly Help us to Port this method. As we are using this method in our whole Application in every file.
Thanks in Advance
The text was updated successfully, but these errors were encountered: