currently i think you can do by keeping some boolean variable that you
can populate after page#onbeforerender
and override your desired component's isVisible() {return my_boolean ;}

On Fri, Aug 10, 2012 at 7:01 PM, Bertrand Guay-Paquet
<ber...@step.polymtl.ca> wrote:
> Hi,
>
> (Using Wicket 6.0-SNAPSHOT, or 1.5.7)
>
> I found a strange behavior when calling Page#isPageStateless(). I have a
> simple label in my personal wicket debug bar which displays "stateless" when
> a page is stateless. It works like so:
>
> new WebMarkupContainer("statelessMarker") {
>     @Override
>     protected void onConfigure() {
>         super.onConfigure();
>         setVisible(getPage().isPageStateless());
>     }
> };
>
> This worked great until I got by chance a page which was stateless except
> for ajax links which were children of a repeater. Here is what happens then:
> 1) onConfigure() is called which calls isPageStateless() and determines the
> page is stateless
> 2) onBeforeRender() is executed which populates the repeaters and adds
> stateful components to the tree
> 3) Since the page was determined stateless in 1), it stays that way
> 4) stateful ajax callback links do not work on the page
>
> Therefore, it seems that isPageStateless() should never be called before
> onBeforeRender() is executed or mayhem may ensue. However, after cursory
> inspection of callers of isPageStateless(), it looks like that is not always
> the case so I'm not certain.
>
> Should this be considered a bug? Should an assertion be made in
> isPageStateless() that onBeforeRender() was executed?
>
> Regards,
> Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
regards,

Vineet Semwal

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

Reply via email to