isVisible Problem

2008-09-25 Thread Markus Haspl
hi, i have a WebPage with a lot of Panels on it. Each Panel overrides the isVisible() method because not every Panel should be displayed on the page. The Problem is: the constructor of each Panel (also which aren't visible) is called and i have a lot of load on the server. So i tried to make a

Re: isVisible Problem

2008-09-25 Thread James Carman
If you don't want the panels on there, put an EmptyPanel in their place instead of making them invisible. On Thu, Sep 25, 2008 at 10:08 AM, Markus Haspl [EMAIL PROTECTED] wrote: hi, i have a WebPage with a lot of Panels on it. Each Panel overrides the isVisible() method because not every

Re: isVisible Problem

2008-09-25 Thread Erik van Oosten
Overriding isVisible can be quite evil. The problem is that it is called also in the detach phase. When isVisible depends on the model, your model is often reloaded! There are 2 solutions: - within method isVisible cache the result, clear the cache in the onDetach. - (recommended) don't

Re: isVisible Problem

2008-09-25 Thread Igor Vaynberg
call your init from this hook: onbeforerender() { if (!hasbeenrendered()) { init(); } } -igor On Thu, Sep 25, 2008 at 7:08 AM, Markus Haspl [EMAIL PROTECTED] wrote: hi, i have a WebPage with a lot of Panels on it. Each Panel overrides the isVisible() method because not every Panel should

Re: isVisible Problem

2008-09-25 Thread Markus Haspl
thank you eric! i will change the Overrides. On Thu, Sep 25, 2008 at 5:09 PM, Erik van Oosten [EMAIL PROTECTED]wrote: Overriding isVisible can be quite evil. The problem is that it is called also in the detach phase. When isVisible depends on the model, your model is often reloaded! There