Hi,
Maybe consider something like this:
interface ClickController {
void click();
}
class YourPage extends WebPage {
protected void onInitialize() {
ClickController clickController =
new ClickController() {
void click() {
doSomething();
}
}
}
add(new YourPanel("id", clickController));
}
class YourPanel extends Panel {
YourPanel(String id, ClickController clickController) {
...
}
protected void onInitialize() {
add(new AjaxButton("btnId") {
protected void onClick(...) {
clickController.click();
}
}
}
}
Alternatively you can let the page implement the ClickController and pass
this to the panel.
With this scenario the panel is reusable and independant from any clients
Cheers
Hans
Am 08.12.10 20:39 schrieb "Peter Karich" unter <[email protected]>:
>
> but I have a way to many panels. Maybe I will simply pass in the
> homePageRef everywhere
> and if I really need a panel in another place I will use the "extension"
> method ...
>
> Regards,
> Peter.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]