This content has been marked as final. Show 7 replies
PS: This is inside the script part of my mxml component.
You have instantiated "tmpSpActionTypesList"
but not "spActionTypesList."
Also, have you verified event.result is not null?
event.result is not null. tmpSpActionTypesList is not null, as i can access "lenght" property, as well as the result itself (
tmpSpActionTypesList\[i\].actionId / tmpSpActionTypesList\[i\].actionToken)... you may see it from the debug!
It's really bizarre, and the problem is in the actual instantiation of FollowUpCardActionVO not working properly (it's null, but still allows access to it's members :S)
PS: \[.i\] is not being properly displayed, but I'm accessing the array items properly...
Hmm, I see. Have you imported FollowUpCardActionVO?
Can you instantiate this class at all?
I note that your toString method on FollowUpCardActionVO is declaring a new string toString, but not setting a value. You then proceed to append strings to it. In other words the first string assignment is:
toString += "\n" + ":: actionid " + actionId;
which is analogous to
toString = null + "\n" + ...
I expect this is why your toString is returning null in your debug message. It's also hazardous to shadow your toString method by declaring a local variable by the same name, though that won't confuse the compiler - just exposes you to errors.
The reason it appears you're getting the error on the add is that your collection has never been initialized - as Tracy noted in her first response, you don't initialize spActionTypesList.
If tmpFollowUpCardActionVO were really null, you wouldn't be able to invoke its toString method :)
Thanks a lot!! It was indeed spActionTypesList which was not initializated... :S
Sorry for replying this long after, but I was focusing on delivering other components for a while, so only now could get back to this one.
Lessons to learn: You can't add a item to an ArrayCollection which is not initialized! Pretty obvious, and this can't be excused by "begginers mistake"... I don't really know what crossed my mind!
Interesting enough to notice that toString is initialized as "null"... :S
btw, I replaced toString by stringToReturn... it definitely is an excellent suggestion!
thanks guys, I'll come back surely with obvious mistakes ;-)