[Hippo-cms7-user] doBeforeRender getting called twice Bug.

Ard Schrijvers a.schrijvers at onehippo.com
Thu Jun 9 22:50:40 CEST 2011


On Thu, Jun 9, 2011 at 5:00 PM, Woonsan Ko <w.ko at onehippo.com> wrote:
> On 06/09/2011 10:52 AM, marijan milicevic wrote:
>>
>> Hi Woonsan,
>> On 06/09/2011 04:30 PM, Woonsan Ko wrote:
>>>
>>> Hi LincStar,
>>>
>>> HST-2 will not invoke components twice or more.
>>
>> yes, it will not, but it *will* if you configure your component twice (or
>> if you reuse one component for different content types)...
>> so, I think this could be the case,
>
> Ah, right. If there are more than one component configuration with the same
> component class, then it could invoke the object twice.
> In this case, there must be two different *component window* objects sharing
> one component instance.

I think it is even easier Woonsan (as Marijan explains): If I
configure the following hst component tree:

rootcomp
   leftcomp (class = mypackage.LeftMenu)
   rightcomp (class = mypackage.LeftMenu)

Now, if the request is executed, then if you add a breakpoint in
LeftMenu, it obviously gets called twice: However, also obviously,
they do not share the component window nor the component instance
(this is from the top of my head: I think the component registry is
based on the id of the configuration, which different for both
leftcomp and rightcomp).

If this is the actual use case of LincStar, he might just need to
inspect whether during the two calls, the instance is actually the
same (look in debugger or print the object and look at hashcode).

If he actually has the doBeforeRender in the same instance, then
indeed it is most likely that there are two requests

Regards ard

>
> Thanks,
>
> Woonsan
>
>> cheers
>> marijan
>>
>>
>>
>>> Can you check if there's any additional requests from the client?
>>> For example, if you have a strange link in the page like <img
>>> src="/site/" />, then it could cause the problem.
>>>
>>
>>
>>> Regards,
>>>
>>> Woonsan
>>>
>>> On 06/09/2011 10:00 AM, lincstar1 wrote:
>>>>
>>>> Hello All,
>>>>
>>>> I have installed sample myhippoproject at my machine it is working
>>>> perfectly..
>>>> But I have one doubt in my mind when i tried to debug it. I noticed each
>>>> component get called twice.
>>>> Is anyone have any idea to ignore this redundant request?
>>>> Due to this, my page take time to load......
>>>>
>>>> Waiting for reply...............
>>>>
>>>> Thanks,
>>>> LincStar
>>>>
>>>> --
>>>> View this message in context:
>>>> http://hippo.2275632.n2.nabble.com/doBeforeRender-getting-called-twice-Bug-tp6457922p6457922.html
>>>> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> Hippo-cms7-user mailing list and forums
>>>> http://www.onehippo.org/cms7/support/forums.html
>>>
>>>
>>
>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/forums.html
>
>
> --
> w.ko at onehippo.com     www.onehippo.com
> Boston - 1 Broadway, Cambridge, MA 02142
> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
> US +1 877 414 4776 (toll free)
> Europe +31(0)20 522 4466
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>



-- 
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com



More information about the Hippo-cms7-user mailing list