Hi Isomorphic,
for a long time I passed parents of a Widget down in the constructor like this
With this I can access the parent from my ListGrid-Subclass and call methods there. But of course this inheritance chain somehow defies reusability and is just not nice.
But you have Canvas.getParentCanvas() that helps here, so that I don't need to pass the parent down, which is great.
The only problem is what do I do with it in SmartGWT in case of SectionStack or more specifically SectionStackSection?
gives me an Cannot cast from Canvas to SectionStackSection-error.
This seems correct, as Canvas is not a Superclass of SectionStackSection. But how do I get to the section from it's items? With another .getParentCanvas() I can get to SectionStack, which is a Subclass of Canvas, but not the SectionStackSection.
I'm sure this will be pretty easy in the end, but right now I don't see how.
Thank you & Best regards
Blama
for a long time I passed parents of a Widget down in the constructor like this
Code:
new MyListGrid(...., MyWhateverClass parent){}
But you have Canvas.getParentCanvas() that helps here, so that I don't need to pass the parent down, which is great.
The only problem is what do I do with it in SmartGWT in case of SectionStack or more specifically SectionStackSection?
Code:
SectionStackSection mySection = (SectionStackSection)this.getParentCanvas()
This seems correct, as Canvas is not a Superclass of SectionStackSection. But how do I get to the section from it's items? With another .getParentCanvas() I can get to SectionStack, which is a Subclass of Canvas, but not the SectionStackSection.
I'm sure this will be pretty easy in the end, but right now I don't see how.
Thank you & Best regards
Blama
Comment