Okay, so I know how to access the outer class that encloses an inner class, whether its anonymous or inner.
But my question is, how to access the outer class if it itself is an inner class? Some code to help:
public final class LocationPage extends BasePage {
private static final String CRITERIA_FORM_ID = "CriteriaForm";
protected Panel onCreateBodyPanel() {
return new ViewBodyPanel(BasePage.BODY_PANEL_ID) {
public void invokeMe() {
// How do I Invoke This Method?
}
private Form<CriteriaBean> helpCreateCriteriaForm() {
return new Form<CriteriaBean>(LocationPage.CRITERIA_FORM_ID) {
@Override
protected void onSubmit() {
LocationPage.this.ViewBodyPanel.invokeMe(); // Compile Error.
}
};
}
};
}
}
UPDATE: For those wanting to see what I am trying to do here, here is a complete code sample. This is actually Apache Wicket specific but I think you can get the idea. Have a look at a method named onSubmit. I added a code comment to help pinpoint it.
UPDATE TWO: Made the code sample to the point. Sorry about that!