Hey there- How do I addElement() to the topGroup of a Spark Panel component skin? For instance, if I create a custom UIComponent, then create an associative skin that uses the Spark Panel as a default, how do I add elements to the topGroup from within the skin? Thanks!
Asked
Active
Viewed 244 times
1 Answers
1
Why didn't you inherit from Panel for your custom component?
- Create a component that inherits from Panel
- Declare a new SkinPart with a the same type as the element you want to add to the topGroup
Override the partAdded/partRemoved methods. In the partAdded, simply add the SkinPart defined to the topGroup. Something like :
if (instance == yourSkinPartId) topGroup.addElement(yourSkinPartId)

Florian F
- 8,822
- 4
- 37
- 50