If we can update the model object and changes its value without problem.
Shouldn't we also be able to assign a new model?
onBeforeRender() {
...
this.setDefaultModel(new ReadonlyStaticModel("state1"));
}
onAfterRender() {
this.setDefaultModel(new ReadonlyStaticModel("state2-reset"));
}
I guess I could use the backing model object as opposed to the model to change
the state.
... Changed to:
onBeforeRender() {
...
getDefaultModel().set("state1"));
}
onAfterRender() {
getDefaultModel().set("state2"));
}
-----Original Message-----
From: Igor Vaynberg [mailto:[email protected]]
Sent: Tuesday, January 25, 2011 12:40 PM
To: [email protected]
Subject: Re: Call onAfterRender and change default model without error
whats the usecase?
-igor
On Tue, Jan 25, 2011 at 9:37 AM, Brown, Berlin [GCG-PFS]
<[email protected]> wrote:
> I tried to do the following below but I got an error could not update
> component hierarchy.
> WicketMessage: Cannot modify component hierarchy after render phase
> has started (page version cant change then anymore)
>
> Is there an event method (like onAfterRender) that I could use without
> error?
>
> Component:
>
> onBeforeRender() {
> ...
> this.setDefaultModel(...);
> }
>
> onAfterRender() {
> this.setSetDefaultModel(...);
> }
>
> Berlin Brown (POL)
>
>
---------------------------------------------------------------------
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]