Hi Sven, I am trying to implement your changes, but am not sure what you
mean:
I have 3 panels in a page
(QuestionCompletePage
->QuestionCompletePanel->CompletableQuestionPanel->QuestionNavigationPanel).

However, QuestionNavigationPanel, that contains my AjaxLink, belongs to two
execution paths (it is used in QuestionCompletePage and QuestionEditPage).

So I create an interface IRefreshable and have QuestionCompletePanel
implement it (because it contains the container that I want to refresh).

public interface IRefreshable {

    public List<Component> getRefreshables();

}

Normally, I would then either have to pass a reference to this panel or
otherwise, navigate down from getPage() to get to the panel. This seems to
be just as much work as including the container for refreshing in the
constructor calls.

Any tips appreciated.

P


B)
> IMHO passing the container into EditableQuestionPanel isn't a good idea -
> why should it know anything about its parent? Instead I'd add a hook method
> into EditableQuestionPanel so that it can notify about changes. The
> containing QuestionEditPanel can then do whatever it needs to update itself
> on an Ajax request.
>
>

Reply via email to