Code:
customMenuComponent.addCustomLink(new CustomLinkComponenet("strlink","Storage Inbox",Index.class) {
protected BookmarkablePageLink getBookmarkablePageLink() {
BookmarkablePageLink bookmarkablePageLink= new BookmarkablePageLink("link",clazz){
protected void onBeforeRender() {
super.onBeforeRender();
}
};
return bookmarkablePageLink;
}
});
customMenuComponent.addCustomLink(new CustomLinkComponenet("strlink","Storage Inbox",Index.class) {
protected BookmarkablePageLink getBookmarkablePageLink() {
BookmarkablePageLink bookmarkablePageLink= super.getBookmarkablePageLink(){
protected void onBeforeRender() {
super.onBeforeRender();
}
};
return bookmarkablePageLink;
}
});
the second block of code does not compile please explain me why and what is the workaround ? i can override a method on a object when I initialize with new but cannot override if I get the object from super or somebody constructs why ?