Issue Details (XML | Word | Printable)

Key: BEEHIVE-542
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Julie Zhuo
Reporter: Julie Zhuo
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Beehive

Multiple popup scripts generated when multiple popup config exist in one page

Created: 21/Apr/05 12:17 PM   Updated: 06/Dec/05 08:00 AM
Return to search
Component/s: NetUI
Affects Version/s: v1m1
Fix Version/s: 1.0.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works j542-patch.txt 2005-08-25 09:16 AM Carlin Rogers 29 kB
Zip Archive Licensed for inclusion in ASF works jira542.ZIP 2005-04-21 12:21 PM Julie Zhuo 2 kB

Resolution Date: 23/Sep/05 03:19 AM


 Description  « Hide
When a page has multple popup config like the following,

        <br/>
        <netui:anchor action="goNested" popup="true">
            <netui:configurePopup width="500" height="500" directories="true"/>
        </netui:anchor>
          
        <br/>
        <netui:anchor action="goNested" popup="true">
            <netui:configurePopup width="500" height="500"
                                  toolbar="false" location="false"
                                  directories="true" status="false"
                                  menubar="false" resizable="false"
                                  scrollbars="false" replace="false"/>
        </netui:anchor>
        
        <br/>

multiple popup window open scripts generated multiple times in the page, see below.

window_Netui_Popup = null;
function Netui_Popup(url, name, features, replace)
{
  if (window_Netui_Popup != null && ! window_Netui_Popup.closed)
  {
    window_Netui_Popup.focus();
    return;
  }
  window_Netui_Popup=open(url, name, features, replace);
  if (window_Netui_Popup.opener == null) window_Netui_Popup.opener=self;
}

window_Netui_Popup = null;
function Netui_Popup(url, name, features, replace)
{
  if (window_Netui_Popup != null && ! window_Netui_Popup.closed)
  {
    window_Netui_Popup.focus();
    return;
  }
  window_Netui_Popup=open(url, name, features, replace);
  if (window_Netui_Popup.opener == null) window_Netui_Popup.opener=self;
}

Expect to see only one block of this script generated.

Repro: Unzip the repro pageflow and put the pageflow into the netui-blanc template wewbapp. Compile and deploy to tomcat. Browse to the pageflow by http://localhost:8080/webapp/directories/Controller.jpf. Once the page is loaded, do a view source and check the JS script that are generated for that page.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rich Feit added a comment - 22/Apr/05 03:42 PM
Because this one's harmless, I'm pushing it to the next release.

Carlin Rogers added a comment - 25/Aug/05 09:16 AM
Rich, here's a patch to help address this bug. My changes for this patch will make
sure the popup support functions are only written once. I did this by managing
a unique (by scope) open popup window in an associated array of windows
rather than writing out the same functions to handle and open the popup windows.
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 an initialization for the window to null
in the associated array.

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

Rich Feit added a comment - 23/Sep/05 03:19 AM
Committed with revision 290996.

Julie Zhuo added a comment - 06/Dec/05 08:00 AM
Verified with rev351894. There is no duplicate funstion scripts anymore. The instances of initialization still shows up as our limitation. So, we close this issue for now.