i moved it up (where attach was)
On 5/8/07, Jan Vermeulen <[EMAIL PROTECTED]> wrote:
In the former 2.0, we created components within a repeater in the
onAttach()
method (during rendering, no changes to the component graph were allowed).
And as I see, that's also what the Wicket ListView did.
In the current trunk, things have changed, so we can no longer create
these
components in onAttach() (one reason is that during resolve, onAttach() is
called on the resolved page). Looking at the new code of ListView, it
seems
that beforeRender() is the right place to create these components.
But then there is another problem: Page:renderPage() and
Component:renderComponent() call isActionAuthorized(RENDER) BEFORE the
call
to beforeRender(). That means that this authorization is no longer called
for any components created during the beforeRender() ! In the former 2.0,
it
was because it is called after the onAttach().
I saw this comment in the code of Component:renderComponent():
// check authorization
// first the component itself
// (after attach as otherwise list views etc wont work)
setRenderAllowed(isActionAuthorized(RENDER));
Since there is no longer onAttach() logic in the ListView, I do not
understand the comment, unless it means that the intention is to call the
authorization on the dynamically created components of the listView. In
that
case, that has stopped working.
So the question is: is it correct that the authorization is checked before
the call to beforeRender() ? In that case, we should call the
authorization
ourselves on the components created in beforeRender(). And maybe ListView
should do the same. Or is this a bug ?
Jan.
--
View this message in context:
http://www.nabble.com/Backporting-from-2.0%3A-onAttach%28%29-or-beforeRender%28%29---tf3710300.html#a10377931
Sent from the Wicket - Dev mailing list archive at Nabble.com.