>> import wicket.markup.html.WebPage;
>> ....
>> if (page instanceof WebPage)
>> {
>>  ((WebPage)page).beforeCallComponent(component, method);
>> }
>>.....
>> if (page instanceof WebPage)
>> {
>>  ((WebPage)page).afterCallComponent(component, method);
>> }
>
>Is that realy a problem? It is not a dependency to another jar, isn't it?

Well, IMHO dependencies should always be justified, wether in the same jar or not.

>So your WebRequestCyle implementations will than look like
> if (component is MyPageA)
> ...
> else if (component is MyPageB)
> ..
> else
> else
> else
> Not sure, this is the better approach.

I didn't write that, this is of course a bad idea.
If someone wants to forward the notification to the page, fine:

protected beforeCallComponent(Component component, Method method) {
 getMyPage(component).,myBeforeCallComponent(component, method);
}

I'd prefer:
protected beforeCallComponent(Component component, Method method) {
 getSpringInjector().injectDependencies(getPage(component));
}

>one could say: create a common base BasePage which implements
>before/afterXXX and invoke an appropriate implementation in
>MyWebRequestCycle if you realy want to do that.

I'd call this a cumbersome approach: Why first forward to the page, just to let the page turn back to the request to do lifecycle things? This requires a common base class for all pages just to do this housekeeping.

Perhaps the modifier of invokeInterface(**Component,Method,Page) could just be changed to protected. This way both solution would be possible.

Sven


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to