You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Carlin Rogers <ca...@gmail.com> on 2005/08/25 02:36:06 UTC

BEEHIVE-542 - Multiple popup scripts generated

Rich, I think this JIRA issue is assigned to you but since I am looking at
BEEHIVE-863 (support for passing a FormBean to a popup), I thought I'd
fix this first. Seemed like it would be easier for me to fix this first before
adding the new feature work for BEEHIVE-683 as it will build on this work.

This specific bug occurs because the multiple anchors/buttons
in the same page, using the <netui:configurePopup> tag feature,
are for a popup in the same request scope. This tag was implemented
to support uniquely scoped popup windows of multiple portlets in a portal.

My patch for this bug (attached to the BEEHIVE-542 in JIRA), modifies
the PopupSupport class for the <netui:configurePopup> tag to make
sure the popup support functions are only written once. PopupSupport
uses CoreScriptFeature to track that the Netui_Popup function is
only written out once rather than multiple times. The new generated
JavaScript uses an associated array to manage unique (by scope)
popup windows rather than writing out the same function repeatedly but
with a scoped name.

The popup support function to open the NetUI popup window now takes
a string as the name to identify the window in the associated array.

This means a button onClick will call the same generated function but
pass an additional string for the scoped popup window. For example,...
    onClick=Netui_Popup_portletB(url,...,false)
is now generated as...
    onClick=Netui_Popup(url,...,false,'Netui_Window_portletB')

Note that for multiple popups on the same page there will still
be multiple instances of the initialization for the window to null
in the associated array.

The various popup tests have been update and are part of this
patch.

Re: BEEHIVE-542 - Multiple popup scripts generated

Posted by Rich Feit <ri...@gmail.com>.
Carlin,

I checked this one in today -- thanks again for the patch.

Rich

Rich Feit wrote:

> Hi Carlin,
>
> This is definitely a better solution -- cleaner than having multiple
> slightly-different popup functions written out to a page.  I have this
> patch applied locally, and I'll get it in immediately after we cut v1.0.
>
> Thanks,
> Rich
>
> Carlin Rogers wrote:
>
>> Rich, I think this JIRA issue is assigned to you but since I am
>> looking at
>> BEEHIVE-863 (support for passing a FormBean to a popup), I thought I'd
>> fix this first. Seemed like it would be easier for me to fix this
>> first before
>> adding the new feature work for BEEHIVE-683 as it will build on this
>> work.
>>
>> This specific bug occurs because the multiple anchors/buttons
>> in the same page, using the <netui:configurePopup> tag feature,
>> are for a popup in the same request scope. This tag was implemented
>> to support uniquely scoped popup windows of multiple portlets in a
>> portal.
>>
>> My patch for this bug (attached to the BEEHIVE-542 in JIRA), modifies
>> the PopupSupport class for the <netui:configurePopup> tag to make
>> sure the popup support functions are only written once. PopupSupport
>> uses CoreScriptFeature to track that the Netui_Popup function is
>> only written out once rather than multiple times. The new generated
>> JavaScript uses an associated array to manage unique (by scope)
>> popup windows rather than writing out the same function repeatedly but
>> with a scoped name.
>>
>> The popup support function to open the NetUI popup window now takes
>> a string as the name to identify the window in the associated array.
>>
>> This means a button onClick will call the same generated function but
>> pass an additional string for the scoped popup window. For example,...
>>    onClick=Netui_Popup_portletB(url,...,false)
>> is now generated as...
>>    onClick=Netui_Popup(url,...,false,'Netui_Window_portletB')
>>
>> Note that for multiple popups on the same page there will still
>> be multiple instances of the initialization for the window to null
>> in the associated array.
>>
>> The various popup tests have been update and are part of this
>> patch.
>>
>>  
>>
>

Re: BEEHIVE-542 - Multiple popup scripts generated

Posted by Rich Feit <ri...@gmail.com>.
Hi Carlin,

This is definitely a better solution -- cleaner than having multiple 
slightly-different popup functions written out to a page.  I have this 
patch applied locally, and I'll get it in immediately after we cut v1.0.

Thanks,
Rich

Carlin Rogers wrote:

>Rich, I think this JIRA issue is assigned to you but since I am looking at
>BEEHIVE-863 (support for passing a FormBean to a popup), I thought I'd
>fix this first. Seemed like it would be easier for me to fix this first before
>adding the new feature work for BEEHIVE-683 as it will build on this work.
>
>This specific bug occurs because the multiple anchors/buttons
>in the same page, using the <netui:configurePopup> tag feature,
>are for a popup in the same request scope. This tag was implemented
>to support uniquely scoped popup windows of multiple portlets in a portal.
>
>My patch for this bug (attached to the BEEHIVE-542 in JIRA), modifies
>the PopupSupport class for the <netui:configurePopup> tag to make
>sure the popup support functions are only written once. PopupSupport
>uses CoreScriptFeature to track that the Netui_Popup function is
>only written out once rather than multiple times. The new generated
>JavaScript uses an associated array to manage unique (by scope)
>popup windows rather than writing out the same function repeatedly but
>with a scoped name.
>
>The popup support function to open the NetUI popup window now takes
>a string as the name to identify the window in the associated array.
>
>This means a button onClick will call the same generated function but
>pass an additional string for the scoped popup window. For example,...
>    onClick=Netui_Popup_portletB(url,...,false)
>is now generated as...
>    onClick=Netui_Popup(url,...,false,'Netui_Window_portletB')
>
>Note that for multiple popups on the same page there will still
>be multiple instances of the initialization for the window to null
>in the associated array.
>
>The various popup tests have been update and are part of this
>patch.
>
>  
>