Question
partRemoved(), includeIn and adding a control to a displayList
Hi,
I'm having a strange behavior with some Gumbo components I developed. For these components I implemented skins and I'm handling the skin parts in the partAdded and the partRemoved functions.
In my application I'm showing one of different components (views) depending on a selection in a list. For this I'm creating the different views without adding them to a displayList (in a Declarations tag). When the selection changes, I replace the displayed view accordingly.
With components that use "includeIn" in their skins I'm getting null pointer exceptions in their partRemoved methods. I noticed that this happens with views I showed once and trying to show again, which means they were added to a displayList, removed then being added again. This seems to make their skin to be unloaded and reloaded.
First question: Is this the normal beahvior or a bug?
Now to the strange part: In the partRemoved method call, sometimes I get null for the instance parameter! I think this happens depending on the actual state of the component. If the skin part should be discarded from the actual state (using includeIn), it's passed as null! In the other hand, it seems that partRemoved is called more than once (probably for the different states?).
Second question: Is this normal behavior or a bug?
Third question: If this is normal, how should I handle these cases? Should I check instance if it's null?
I found nothing about this behavior in the specs.
Bye,
--
Haykel Ben Jemia
Allmas
Web & RIA Development
http://www.allmas-tn.com
I'm having a strange behavior with some Gumbo components I developed. For these components I implemented skins and I'm handling the skin parts in the partAdded and the partRemoved functions.
In my application I'm showing one of different components (views) depending on a selection in a list. For this I'm creating the different views without adding them to a displayList (in a Declarations tag). When the selection changes, I replace the displayed view accordingly.
With components that use "includeIn" in their skins I'm getting null pointer exceptions in their partRemoved methods. I noticed that this happens with views I showed once and trying to show again, which means they were added to a displayList, removed then being added again. This seems to make their skin to be unloaded and reloaded.
First question: Is this the normal beahvior or a bug?
Now to the strange part: In the partRemoved method call, sometimes I get null for the instance parameter! I think this happens depending on the actual state of the component. If the skin part should be discarded from the actual state (using includeIn), it's passed as null! In the other hand, it seems that partRemoved is called more than once (probably for the different states?).
Second question: Is this normal behavior or a bug?
Third question: If this is normal, how should I handle these cases? Should I check instance if it's null?
I found nothing about this behavior in the specs.
Bye,
--
Haykel Ben Jemia
Allmas
Web & RIA Development
http://www.allmas-tn.com
