Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
Like this? new YourComponent(id) { @Override public boolean isVisible() { return yourCondition; } } On Thu, Nov 20, 2008 at 9:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] -- Jeremy Thomerson http://www.wickettraining.com
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
That's bad because isVisible is invoked many times (50+ sometimes) per request so no complex logic can be put there. 2008/11/20 Jeremy Thomerson [EMAIL PROTECTED]: Like this? new YourComponent(id) { @Override public boolean isVisible() { return yourCondition; } } On Thu, Nov 20, 2008 at 9:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
I'm trying to choose strategy for handling conditional component visibility (and we have complex tree where many components are conditionally visible). Overriding isVisible is bad, because many calls. overriding onBeforeRender and callOnBeforeRender is bad, because children visibility is calculated even when there is no need. I'd prefer overriding onBeforeRender and skipping child traversion if isVisible = false, but that cannot be done with current Component#onBeforeRender implementation. 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] - 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]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
i still dont see a concrete usecase -igor On Thu, Nov 20, 2008 at 8:04 AM, Marat Radchenko [EMAIL PROTECTED] wrote: I'm trying to choose strategy for handling conditional component visibility (and we have complex tree where many components are conditionally visible). Overriding isVisible is bad, because many calls. overriding onBeforeRender and callOnBeforeRender is bad, because children visibility is calculated even when there is no need. I'd prefer overriding onBeforeRender and skipping child traversion if isVisible = false, but that cannot be done with current Component#onBeforeRender implementation. 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
private Boolean visible = null; public boolean isVisible() { if (visible == null) { visible = [ put your complicated logic here]; } return visible; } public void onDetach() { super.onDetach(); visible = null; } What's wrong with this? -Matej On Thu, Nov 20, 2008 at 5:04 PM, Marat Radchenko [EMAIL PROTECTED] wrote: I'm trying to choose strategy for handling conditional component visibility (and we have complex tree where many components are conditionally visible). Overriding isVisible is bad, because many calls. overriding onBeforeRender and callOnBeforeRender is bad, because children visibility is calculated even when there is no need. I'd prefer overriding onBeforeRender and skipping child traversion if isVisible = false, but that cannot be done with current Component#onBeforeRender implementation. 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]