You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sunilmanu <su...@gmail.com> on 2007/10/01 20:30:37 UTC
T4: Components in Page get Initialized even if its in IF condition
block ?
Hello Everyone,
We are using Tapestry 4.0.2 . Recently we noticed a following issue :
We have a HTML page that has multiple COMPONENTS but are in IF conditional
block. No matter how the condition is evaluated to TRUE /FALSE, the
Components are getting called i.e. the PAGEBEGINRENDER method is being
called eventhough they are NOT rendered !!
HTML
=====
In the above piece, it renders properly in the browser but the
PAGEBEGINRENDER method is fired 3 times even if the Condition is FALSE.
We can definitely pass one more parameter to the component telling it
whether to process the iteration or not but is there a better way to handle
this unwanted Component initialization ??
Thanks,
Sunil
--
View this message in context: http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-even-if-its-in-IF-condition-block---tf4550131.html#a12984881
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T4: Components in Page get Initialized even if its in IF condition
block ?
Posted by andyhot <an...@di.uoa.gr>.
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/AbstractComponent.html#prepareForRender(org.apache.tapestry.IRequestCycle)
sunilmanu wrote:
> Thanks for the reply and information..
>
> So is there any other method that could be used to initialize the properties
> needed for the page other than pagebeginrender method .. ?
> Or I have to pass in a parameter and check it's value inside the
> pageBeginRender and see whether to process or not ?
>
> thanks,
> Sunil
>
>
> Robert Zeigler wrote:
>
>> That's correct; think of your component as a listener, listening, not
>> for when /it/ is starting to be rendered, but when the /page/ is
>> starting to render.
>> So, the component's "pageBeginRender" is always called, since the
>> component is asking to be notified of when the /page/ starts to
>> render, regardless of whether the component is rendered.
>> Basically, the order of events is along the lines of:
>>
>> fire page validation events
>> fire page begin render events
>> render component 1 in page
>> ...
>> render component n in page
>> fire page end render event
>>
>> Robert
>>
>> On Oct 1, 2007, at 10/12:17 PM , sunilmanu wrote:
>>
>>
>>> Howard,
>>> thanks for ur reply..but still my doubt is..
>>>
>>> I can understand if the Component was to be Rendered, the
>>> pagebeingrender
>>> method being fired.
>>> But why the method is fired, if the component is NOT going to be
>>> rendered ?
>>> HTML just has a reference to that Component inside a IF block, so
>>> is that
>>> line enough to trigger the pageBeginRender of the component ?
>>>
>>> Thanks,
>>> Sunil
>>>
>>>
>>> Howard Lewis Ship wrote:
>>>
>>>> This is normal. There are most specific methods that get called
>>>> in the
>>>> lifecycle of the individual component.
>>>>
>>>> pageBeginRender() means the Page is beginning to render, long
>>>> before any
>>>> of
>>>> the components render.
>>>>
>>>> On 10/1/07, sunilmanu <su...@gmail.com> wrote:
>>>>
>>>>> Hello Everyone,
>>>>>
>>>>> We are using Tapestry 4.0.2 . Recently we noticed a following
>>>>> issue :
>>>>>
>>>>> We have a HTML page that has multiple COMPONENTS but are in IF
>>>>> conditional
>>>>> block. No matter how the condition is evaluated to TRUE /FALSE, the
>>>>> Components are getting called i.e. the PAGEBEGINRENDER method is
>>>>> being
>>>>> called eventhough they are NOT rendered !!
>>>>>
>>>>> HTML
>>>>> =====
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> In the above piece, it renders properly in the browser but the
>>>>> PAGEBEGINRENDER method is fired 3 times even if the Condition is
>>>>> FALSE.
>>>>>
>>>>> We can definitely pass one more parameter to the component
>>>>> telling it
>>>>> whether to process the iteration or not but is there a better way to
>>>>> handle
>>>>> this unwanted Component initialization ??
>>>>>
>>>>> Thanks,
>>>>> Sunil
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-
>>>>> even-if-its-in-IF-condition-block---tf4550131.html#a12984881
>>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> --------------------------------------------------------------------
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Howard M. Lewis Ship
>>>> Partner and Senior Architect at Feature50
>>>>
>>>> Creator Apache Tapestry and Apache HiveMind
>>>>
>>>>
>>>>
>>> --
>>> View this message in context: http://www.nabble.com/T4%3A-
>>> Components-in-Page-get-Initialized-even-if-its-in-IF-condition-
>>> block---tf4550131.html#a12985833
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T4: Components in Page get Initialized even if its in IF
condition block ?
Posted by sunilmanu <su...@gmail.com>.
Thanks for the reply and information..
So is there any other method that could be used to initialize the properties
needed for the page other than pagebeginrender method .. ?
Or I have to pass in a parameter and check it's value inside the
pageBeginRender and see whether to process or not ?
thanks,
Sunil
Robert Zeigler wrote:
>
> That's correct; think of your component as a listener, listening, not
> for when /it/ is starting to be rendered, but when the /page/ is
> starting to render.
> So, the component's "pageBeginRender" is always called, since the
> component is asking to be notified of when the /page/ starts to
> render, regardless of whether the component is rendered.
> Basically, the order of events is along the lines of:
>
> fire page validation events
> fire page begin render events
> render component 1 in page
> ...
> render component n in page
> fire page end render event
>
> Robert
>
> On Oct 1, 2007, at 10/12:17 PM , sunilmanu wrote:
>
>>
>> Howard,
>> thanks for ur reply..but still my doubt is..
>>
>> I can understand if the Component was to be Rendered, the
>> pagebeingrender
>> method being fired.
>> But why the method is fired, if the component is NOT going to be
>> rendered ?
>> HTML just has a reference to that Component inside a IF block, so
>> is that
>> line enough to trigger the pageBeginRender of the component ?
>>
>> Thanks,
>> Sunil
>>
>>
>> Howard Lewis Ship wrote:
>>>
>>> This is normal. There are most specific methods that get called
>>> in the
>>> lifecycle of the individual component.
>>>
>>> pageBeginRender() means the Page is beginning to render, long
>>> before any
>>> of
>>> the components render.
>>>
>>> On 10/1/07, sunilmanu <su...@gmail.com> wrote:
>>>>
>>>>
>>>> Hello Everyone,
>>>>
>>>> We are using Tapestry 4.0.2 . Recently we noticed a following
>>>> issue :
>>>>
>>>> We have a HTML page that has multiple COMPONENTS but are in IF
>>>> conditional
>>>> block. No matter how the condition is evaluated to TRUE /FALSE, the
>>>> Components are getting called i.e. the PAGEBEGINRENDER method is
>>>> being
>>>> called eventhough they are NOT rendered !!
>>>>
>>>> HTML
>>>> =====
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> In the above piece, it renders properly in the browser but the
>>>> PAGEBEGINRENDER method is fired 3 times even if the Condition is
>>>> FALSE.
>>>>
>>>> We can definitely pass one more parameter to the component
>>>> telling it
>>>> whether to process the iteration or not but is there a better way to
>>>> handle
>>>> this unwanted Component initialization ??
>>>>
>>>> Thanks,
>>>> Sunil
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-
>>>> even-if-its-in-IF-condition-block---tf4550131.html#a12984881
>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Howard M. Lewis Ship
>>> Partner and Senior Architect at Feature50
>>>
>>> Creator Apache Tapestry and Apache HiveMind
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/T4%3A-
>> Components-in-Page-get-Initialized-even-if-its-in-IF-condition-
>> block---tf4550131.html#a12985833
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-even-if-its-in-IF-condition-block---tf4550131.html#a12986629
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T4: Components in Page get Initialized even if its in IF condition block ?
Posted by Robert Zeigler <ro...@scazdl.org>.
That's correct; think of your component as a listener, listening, not
for when /it/ is starting to be rendered, but when the /page/ is
starting to render.
So, the component's "pageBeginRender" is always called, since the
component is asking to be notified of when the /page/ starts to
render, regardless of whether the component is rendered.
Basically, the order of events is along the lines of:
fire page validation events
fire page begin render events
render component 1 in page
...
render component n in page
fire page end render event
Robert
On Oct 1, 2007, at 10/12:17 PM , sunilmanu wrote:
>
> Howard,
> thanks for ur reply..but still my doubt is..
>
> I can understand if the Component was to be Rendered, the
> pagebeingrender
> method being fired.
> But why the method is fired, if the component is NOT going to be
> rendered ?
> HTML just has a reference to that Component inside a IF block, so
> is that
> line enough to trigger the pageBeginRender of the component ?
>
> Thanks,
> Sunil
>
>
> Howard Lewis Ship wrote:
>>
>> This is normal. There are most specific methods that get called
>> in the
>> lifecycle of the individual component.
>>
>> pageBeginRender() means the Page is beginning to render, long
>> before any
>> of
>> the components render.
>>
>> On 10/1/07, sunilmanu <su...@gmail.com> wrote:
>>>
>>>
>>> Hello Everyone,
>>>
>>> We are using Tapestry 4.0.2 . Recently we noticed a following
>>> issue :
>>>
>>> We have a HTML page that has multiple COMPONENTS but are in IF
>>> conditional
>>> block. No matter how the condition is evaluated to TRUE /FALSE, the
>>> Components are getting called i.e. the PAGEBEGINRENDER method is
>>> being
>>> called eventhough they are NOT rendered !!
>>>
>>> HTML
>>> =====
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> In the above piece, it renders properly in the browser but the
>>> PAGEBEGINRENDER method is fired 3 times even if the Condition is
>>> FALSE.
>>>
>>> We can definitely pass one more parameter to the component
>>> telling it
>>> whether to process the iteration or not but is there a better way to
>>> handle
>>> this unwanted Component initialization ??
>>>
>>> Thanks,
>>> Sunil
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-
>>> even-if-its-in-IF-condition-block---tf4550131.html#a12984881
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>> --
>> Howard M. Lewis Ship
>> Partner and Senior Architect at Feature50
>>
>> Creator Apache Tapestry and Apache HiveMind
>>
>>
>
> --
> View this message in context: http://www.nabble.com/T4%3A-
> Components-in-Page-get-Initialized-even-if-its-in-IF-condition-
> block---tf4550131.html#a12985833
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T4: Components in Page get Initialized even if its in IF
condition block ?
Posted by sunilmanu <su...@gmail.com>.
Howard,
thanks for ur reply..but still my doubt is..
I can understand if the Component was to be Rendered, the pagebeingrender
method being fired.
But why the method is fired, if the component is NOT going to be rendered ?
HTML just has a reference to that Component inside a IF block, so is that
line enough to trigger the pageBeginRender of the component ?
Thanks,
Sunil
Howard Lewis Ship wrote:
>
> This is normal. There are most specific methods that get called in the
> lifecycle of the individual component.
>
> pageBeginRender() means the Page is beginning to render, long before any
> of
> the components render.
>
> On 10/1/07, sunilmanu <su...@gmail.com> wrote:
>>
>>
>> Hello Everyone,
>>
>> We are using Tapestry 4.0.2 . Recently we noticed a following issue :
>>
>> We have a HTML page that has multiple COMPONENTS but are in IF
>> conditional
>> block. No matter how the condition is evaluated to TRUE /FALSE, the
>> Components are getting called i.e. the PAGEBEGINRENDER method is being
>> called eventhough they are NOT rendered !!
>>
>> HTML
>> =====
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> In the above piece, it renders properly in the browser but the
>> PAGEBEGINRENDER method is fired 3 times even if the Condition is FALSE.
>>
>> We can definitely pass one more parameter to the component telling it
>> whether to process the iteration or not but is there a better way to
>> handle
>> this unwanted Component initialization ??
>>
>> Thanks,
>> Sunil
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-even-if-its-in-IF-condition-block---tf4550131.html#a12984881
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Howard M. Lewis Ship
> Partner and Senior Architect at Feature50
>
> Creator Apache Tapestry and Apache HiveMind
>
>
--
View this message in context: http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-even-if-its-in-IF-condition-block---tf4550131.html#a12985833
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T4: Components in Page get Initialized even if its in IF condition block ?
Posted by Howard Lewis Ship <hl...@gmail.com>.
This is normal. There are most specific methods that get called in the
lifecycle of the individual component.
pageBeginRender() means the Page is beginning to render, long before any of
the components render.
On 10/1/07, sunilmanu <su...@gmail.com> wrote:
>
>
> Hello Everyone,
>
> We are using Tapestry 4.0.2 . Recently we noticed a following issue :
>
> We have a HTML page that has multiple COMPONENTS but are in IF conditional
> block. No matter how the condition is evaluated to TRUE /FALSE, the
> Components are getting called i.e. the PAGEBEGINRENDER method is being
> called eventhough they are NOT rendered !!
>
> HTML
> =====
>
>
>
>
>
>
>
>
>
>
>
> In the above piece, it renders properly in the browser but the
> PAGEBEGINRENDER method is fired 3 times even if the Condition is FALSE.
>
> We can definitely pass one more parameter to the component telling it
> whether to process the iteration or not but is there a better way to
> handle
> this unwanted Component initialization ??
>
> Thanks,
> Sunil
>
> --
> View this message in context:
> http://www.nabble.com/T4%3A-Components-in-Page-get-Initialized-even-if-its-in-IF-condition-block---tf4550131.html#a12984881
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Partner and Senior Architect at Feature50
Creator Apache Tapestry and Apache HiveMind