On 10/08/2012 12:12 PM, vineet semwal wrote:
it might give you wrong result even if you add your component after
adding all the components because  some components foreg. a repeater
like listview/dataview/gridview  add children in onbeforerender so
isPageStateless() can be assumed to work correctly only after
onbeforerender
Yes that's exactly what I wanted to say! The repeaters are only populated in their onBeforeRender() which is executed after onConfigure().

that caching part is ok imho   for isPageStateless() ,actually that
cached variable is reset in page#onbeforerender which is the another
reason isPageStateless()  should work correctly after onbeforerender
I hadn't noticed that reset in Page#onBeforeRender() so I had a look since it would contradict my observations.

This is the stack trace when my label's onConfigure() is reached :
TmpPage$1.onConfigure() line: 24 <-- my stateless indicator label; calls isPageStateless()
TmpPage$1(Component).configure() line: 1028
TmpPage$1(Component).internalBeforeRender() line: 913
TmpPage$1(Component).beforeRender() line: 990
TmpPage(MarkupContainer).onBeforeRenderChildren() line: 1688
TmpPage(Component).onBeforeRender() line: 3830
TmpPage(Page).onBeforeRender() line: 802 <--- line 799 already did the reset of the cached "stateless" var
TmpPage(Component).internalBeforeRender() line: 922
TmpPage(Component).beforeRender() line: 990
TmpPage(Component).internalPrepareForRender(boolean) line: 2204
TmpPage(Page).internalPrepareForRender(boolean) line: 247
TmpPage(Component).render() line: 2289
TmpPage(Page).renderPage() line: 1021

This stack trace occurs before the repeating view is populated which would render the page stateful and causes the Page to cache that it is stateless.

By the way, I did find a workaround to achieve the desired effect so that's not why I brought this up here. I'm just concerned that such erroneous computations of the page's stateless state might cause other bugs down the road.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to