Hello,
I've searched the web and I see there are a lot of hits for what I'm looking
for but I cannot quite pinpoint the perfect solution (easiest) for this
simple thing.
What I need is to be able to extend a base page and put into some places
some extra panels. I designed the places in the base
you can provide factory methods in your base page like
protected abstract Component newHeader(String id, IModel model);
in the constructor of base page do:
add(newHeader(header, someModelOrNull));
and just override/implement the factory method in your concrete page
classes.
hth,
Gerolf
On
This is planned for the next release (not the genrerics only release
if that will be the 1.4)
On 3/20/08, Cristi Manole [EMAIL PROTECTED] wrote:
Hello,
I've searched the web and I see there are a lot of hits for what I'm looking
for but I cannot quite pinpoint the perfect solution (easiest)
Gerolf Seitz wrote:
you can provide factory methods in your base page like
protected abstract Component newHeader(String id, IModel model);
in the constructor of base page do:
add(newHeader(header, someModelOrNull));
and just override/implement the factory method in your concrete page
i agree with you. i had to fight similar problems and came up with
similar (ugly) work arounds.
let's see how the post-1.4 solution works out ;)
Gerolf
On Thu, Mar 20, 2008 at 10:12 AM, Sebastiaan van Erk [EMAIL PROTECTED]
wrote:
Gerolf Seitz wrote:
you can provide factory methods in your
the workaround is quiet easy
class mypage extends webpage {
onbeforerender() {
if (get(panel1)==null) {
add(newPanel1(panel1));
}
super.onbeforerender();
}
}
-igor
On Thu, Mar 20, 2008 at 2:12 AM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
Gerolf Seitz wrote:
but is a bit against our coding styles by creating the page in the
constructor
But i agree that works for now.
But multiple childs support would be very nice to have if it is just a
simple add on to the current way of doing.
But first lets i guess bring out 1.4 generics... (if i counted the votes
Yes, Johan told me about that one. :-)
But I really think that's quite ugly too... :( I really don't want to
add hooks to do something that is just regular initialization of the
component hierarchy of the page... And whenever possible I think my
other work around is at least more intuitive...