Author: rich
Date: Thu Feb 24 18:37:33 2005
New Revision: 155291

URL: http://svn.apache.org/viewcvs?view=rev&rev=155291
Log:
Fixes for:
    - http://issues.apache.org/jira/browse/BEEHIVE-350 : Popup window 
parameters not being passed to custom popup javascript function
    - http://issues.apache.org/jira/browse/BEEHIVE-347 : Setting attribute 
popup="false" on supported tags creates popup javascript anyway
    - http://issues.apache.org/jira/browse/BEEHIVE-213 : Multiple popups of the 
same type are allowed

DRT/BVT: netui (WinXP)
BB: self (linux)

Note: the MockPortal and MockPortalListenTo tests fail after this checkin.  
This should go away when http://issues.apache.org/jira/browse/BEEHIVE-359 is 
resolved.


Added:
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/MockPortal.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalPopupWindows.xml
   (with props)
Modified:
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessor.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/CoreScriptFeature.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/mockportal/MockPortalUrlRewriter.java
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/popup/index.jsp
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortal.xml
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PopupAttribute.xml
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNestedPopup.xml

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
 Thu Feb 24 18:37:33 2005
@@ -133,6 +133,7 @@
     public static final String NULLABLE_ATTR = "nullable";
     public static final String REQUIRED_ATTR = "required";
     public static final String USE_FORM_BEAN_ATTR = "useFormBean";
+    public static final String USE_FORM_BEAN_TYPE_ATTR = "useFormBeanType";
     public static final String READONLY_ATTR = "readOnly";
     public static final String RESTORE_QUERY_STRING_ATTR = 
"restoreQueryString";
     public static final String VALUE_ATTR = "value";

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessor.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessor.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessor.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessor.java
 Thu Feb 24 18:37:33 2005
@@ -40,6 +40,7 @@
         extends TwoPhaseAnnotationProcessor
 {
     private HashMap< String, SourceFileInfo > _sourceFileInfo;
+    private SourceFileInfo _singleSourceFileInfo = null;
     private ResourceBundle _messages;
     
     
@@ -110,12 +111,23 @@
     
     protected SourceFileInfo getSourceFileInfo( ClassDeclaration decl )
     {
-        return _sourceFileInfo.get( decl.getQualifiedName() );
+        assert _sourceFileInfo != null || _singleSourceFileInfo != null;
+        assert _sourceFileInfo == null || _singleSourceFileInfo == null;
+        return _singleSourceFileInfo != null ? _singleSourceFileInfo : 
_sourceFileInfo.get( decl.getQualifiedName() );
     }
 
     protected void setSourceFileInfo( ClassDeclaration decl, SourceFileInfo 
sourceFileInfo )
     {
-        _sourceFileInfo.put( decl.getQualifiedName(), sourceFileInfo );
+        assert _sourceFileInfo != null || _singleSourceFileInfo == null;
+        
+        if ( _sourceFileInfo != null )
+        {
+            _sourceFileInfo.put( decl.getQualifiedName(), sourceFileInfo );
+        }
+        else
+        {
+            _singleSourceFileInfo = sourceFileInfo;
+        }
     }
     
     protected static boolean expectAnnotation( ClassDeclaration classDecl, 
String annotationBaseName,

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSimpleActionModel.java
 Thu Feb 24 18:37:33 2005
@@ -24,6 +24,7 @@
 import com.sun.mirror.declaration.ClassDeclaration;
 import com.sun.mirror.declaration.FieldDeclaration;
 import com.sun.mirror.declaration.AnnotationMirror;
+import com.sun.mirror.type.TypeMirror;
 
 import java.util.List;
 
@@ -49,6 +50,13 @@
         else
         {
             setReadonly( true );     // can't modify member state; mark as 
read-only
+            
+            TypeMirror formBeanType = CompilerUtils.getTypeMirror( annotation, 
USE_FORM_BEAN_TYPE_ATTR, true );
+            
+            if ( formBeanType != null )
+            {
+                setFormBeanName( addFormBean( formBeanType, parentApp ) );
+            }
         }
     }
 

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
 Thu Feb 24 18:37:33 2005
@@ -45,6 +45,11 @@
                 { PATH_ATTR, TILES_DEFINITION_ATTR, RETURN_ACTION_ATTR, 
NAVIGATE_TO_ATTR, FORWARD_REF_ATTR, ACTION_ATTR }
             };
     
+    private static String[][] MUTUALLY_EXCLUSIVE_ATTRS =
+            {
+                { USE_FORM_BEAN_ATTR, USE_FORM_BEAN_TYPE_ATTR }
+            };
+    
     
     private ForwardGrammar _forwardGrammar;
     
@@ -63,7 +68,12 @@
         //
         _forwardGrammar = new SimpleActionGrammarPart2();
     }
-    
+
+    public String[][] getMutuallyExclusiveAttrs()
+    {
+        return MUTUALLY_EXCLUSIVE_ATTRS;
+    }
+
     protected boolean onBeginCheck( AnnotationMirror annotation, 
AnnotationMirror[] parentAnnotations,
                                     MemberDeclaration classMember )
     {

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
 Thu Feb 24 18:37:33 2005
@@ -272,6 +272,12 @@
          * (optional )
          */
         String useFormBean() default "";
+        
+        /**
+         * the type of form bean to use for this action
+         * (optional )
+         */
+        Class useFormBeanType() default Void.class;
 
         /**
          * is this action read-only, i.e., is it guaranteed not to modify 
member state

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
 Thu Feb 24 18:37:33 2005
@@ -194,7 +194,7 @@
      */
     public void setPopup(boolean popup)
     {
-        _popupSupport = new PopupSupport();
+        _popupSupport = (popup ? new PopupSupport() : null);
     }
 
 
@@ -468,7 +468,7 @@
                 _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, 
ONCLICK, entry);
             }
             else if (_popupSupport != null) {
-                _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, 
ONCLICK, _popupSupport.getOnClick(_state.href));
+                _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, 
ONCLICK, _popupSupport.getOnClick(request,_state.href));
                 // Jira 299
                 //_state.onClick = _popupSupport.getOnClick(_state.href);
             }

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
 Thu Feb 24 18:37:33 2005
@@ -367,7 +367,7 @@
 
                 if (href != null) {
                     href = response.encodeURL(href);
-                    setOnClick(_popupSupport.getOnClick(href));
+                    setOnClick(_popupSupport.getOnClick(request,href));
                 }
             }
         }

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
 Thu Feb 24 18:37:33 2005
@@ -18,7 +18,8 @@
 package org.apache.beehive.netui.tags.html;
 
 import org.apache.beehive.netui.pageflow.internal.InternalConstants;
-import org.apache.beehive.netui.tags.AbstractClassicTag;
+import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
+import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
 import org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer;
 import org.apache.beehive.netui.tags.javascript.CoreScriptFeature;
 import org.apache.beehive.netui.tags.javascript.IScriptReporter;
@@ -33,13 +34,13 @@
 class PopupSupport
 {
     private static final String VIEW_RENDERER_CLASS_NAME = 
ReturnActionViewRenderer.class.getName();
-    private static final String ON_POPUP_DONE_FUNC = "Netui_OnPopupDone_";
+    private static final String ON_POPUP_DONE_FUNC = "Netui_OnPopupDone";
+    private static final String POPUP_FUNC = "Netui_Popup";
 
     private String _name = "";
     private HashMap _features;
     private boolean _replace = false;
     private String _onPopupDone;
-    private String _defaultOnPopupDone;
     private String _popupFunc;
 
     public void setName(String name)
@@ -117,67 +118,57 @@
         _popupFunc = popupFunc;
     }
 
-    public String getOnClick(String url)
+    public String getOnClick(ServletRequest req, String url)
     {
-        if (_popupFunc != null) {
-            return ScriptRequestState.getString("popupSupportOnClickCustom", 
new Object[]{_popupFunc});
-        }
-        else {
-            StringBuilder features = new StringBuilder();
-
-            if (_features != null) {
-                boolean firstOne = true;
-                for (Object i : _features.entrySet()) {
-                    Map.Entry entry = (Map.Entry) i;
-                    if (!firstOne) {
-                        features.append(',');
-                    }
-                    features.append(entry.getKey());
-                    features.append('=');
-                    features.append(entry.getValue());
-                    firstOne = false;
+        // Build up the string that's passed to javascript open() to specify 
window features.
+        StringBuilder features = new StringBuilder();
+        
+        if (_features != null) {
+            boolean firstOne = true;
+            for (Object i : _features.entrySet()) {
+                Map.Entry entry = (Map.Entry) i;
+                if (!firstOne) {
+                    features.append(',');
                 }
+                features.append(entry.getKey());
+                features.append('=');
+                features.append(entry.getValue());
+                firstOne = false;
             }
-
-            Object[] args = new Object[]{url, _name, features.toString(), 
_replace};
-            return ScriptRequestState.getString("popupSupportOnClick", args);
         }
+        
+        String popupFunc = (_popupFunc != null ? _popupFunc : 
getScopedFunctionName(req, POPUP_FUNC));
+        Object[] args = new Object[]{popupFunc, url, _name, 
features.toString(), _replace};
+        return ScriptRequestState.getString("popupSupportOnClick", args);
     }
 
     public void addParams(IUrlParams urlParams, ServletRequest request)
             throws JspException
     {
         
urlParams.addParameter(InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM, 
VIEW_RENDERER_CLASS_NAME, null);
-        _defaultOnPopupDone = ON_POPUP_DONE_FUNC + getNextId(request);
-        String onPopupDone = _onPopupDone != null ? _onPopupDone : 
_defaultOnPopupDone;
+        String onPopupDone = (_onPopupDone != null ? _onPopupDone : 
ON_POPUP_DONE_FUNC);
         
urlParams.addParameter(ReturnActionViewRenderer.getCallbackParamName(), 
onPopupDone, null);
-    }
-
-    /**
-     * This method will generate the next unique int within this request.
-     * @param req the Request
-     * @return the next unique integer for this request.
-     */
-    private static int getNextId(ServletRequest req)
-    {
-        Integer i = (Integer) 
req.getAttribute(AbstractClassicTag.NETUI_UNIQUE_CNT);
-        if (i == null) {
-            i = new Integer(0);
+        
+        ScopedRequest scopedRequest = 
ScopedServletUtils.unwrapRequest(request);
+        if (scopedRequest != null) {
+            urlParams.addParameter(ScopedServletUtils.SCOPE_ID_PARAM, 
scopedRequest.getScopeKey().toString(), null);
         }
-
-        int ret = i.intValue();
-        req.setAttribute(AbstractClassicTag.NETUI_UNIQUE_CNT, new Integer(ret 
+ 1));
-        return ret;
     }
 
     public void writeScript(ServletRequest req, ScriptRequestState srs, 
IScriptReporter scriptReporter, AbstractRenderAppender results)
     {
         // Write the generic function for popping a window.
-        srs.writeFeature(scriptReporter, results, 
CoreScriptFeature.POPUP_FUNC, true, false, null);
+        String popupFunc = getScopedFunctionName(req, POPUP_FUNC);
+        srs.writeFeature(scriptReporter, results, "popupSupportPopupWindow", 
new Object[]{popupFunc});
 
         // Write the callback that's triggered when the popup window is 
closing.
-        assert (_defaultOnPopupDone != null);   // addParams() should ensure 
that this isn't null
-        srs.writeFeature(scriptReporter, results, "popupSupportOnPopupDone", 
new Object[]{_defaultOnPopupDone});
+        srs.writeFeature(scriptReporter, results, 
CoreScriptFeature.POPUP_DONE, true, false, new Object[]{ON_POPUP_DONE_FUNC});
+    }
+    
+    private static String getScopedFunctionName(ServletRequest req, String 
funcName)
+    {
+        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(req);
+        return (scopedRequest != null ? funcName + '_' + 
scopedRequest.getScopeKey() : funcName);
     }
 
     private void putFeature(String featureName, boolean val)

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
 Thu Feb 24 18:37:33 2005
@@ -103,7 +103,7 @@
             {
                 IUrlParams urlParams = (IUrlParams) parentParent;
                 
urlParams.addParameter(ReturnActionViewRenderer.getMapItemParamName(),
-                        _dataSource + ReturnActionViewRenderer.getDelim() + 
_tagIdRef,
+                        _dataSource + ReturnActionViewRenderer.getDelim() + 
getIdForTagId(_tagIdRef),
                         null);
             }
         }

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/CoreScriptFeature.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/CoreScriptFeature.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/CoreScriptFeature.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/CoreScriptFeature.java
 Thu Feb 24 18:37:33 2005
@@ -28,7 +28,7 @@
     SCOPE_LOOKUP                (0x0008),
     ROLLOVER                    (0x0010),
     ANCHOR_SUBMIT               (0x0020),
-    POPUP_FUNC                  (0x0040),
+    POPUP_DONE                  (0x0040),
     ALLOCATE_LEGACY             (0x0080),
     ALLOCATE_ID                 (0x0100),
     ALLOCATE_NAME               (0x0200),

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptContainer.java
 Thu Feb 24 18:37:33 2005
@@ -23,11 +23,14 @@
 import org.apache.beehive.netui.tags.rendering.ScriptTag;
 import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
 import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
+import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
+import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.SimpleTagSupport;
 import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.ServletRequest;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -273,15 +276,26 @@
      */
     protected String getRealIdScope()
     {
+        ServletRequest request = pageContext.getRequest();
+        
         // default to the set idScope.
         String idScope = _idScope;
 
         // if there isn't a set idScope and generate scope is on, generate the 
scope id.
         if (_idScope == null && _genScope) {
-            int id = getNextId((HttpServletRequest) pageContext.getRequest());
+            int id = getNextId(request);
             idScope = "n" + Integer.toString(id);
             _idScope = idScope;
         }
+        
+        // if there's still no idScope and we're in a ScopedRequest, use the 
scope-key from the request.
+        if (_idScope == null) {
+            ScopedRequest scopedRequest = 
ScopedServletUtils.unwrapRequest(request);
+            if (scopedRequest != null) {
+                _idScope = scopedRequest.getScopeKey().toString();
+            }
+        }
+        
         return idScope;
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java
 Thu Feb 24 18:37:33 2005
@@ -282,8 +282,8 @@
                 return "anchorFormSubmit";
             case SET_FOCUS:
                 return "setFocus";
-            case POPUP_FUNC:
-                return "popupFunc";
+            case POPUP_DONE:
+                return "popupDone";
             case ROLLOVER:
                 return "rollover";
             case TREE_INIT:

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties
 Thu Feb 24 18:37:33 2005
@@ -73,20 +73,23 @@
 buttonDisableAction=button_disable(this);return false;
 
 # generic method to open a popup window
-popupFunc=\
-function netui_popup(url, name, features, replace)\n\
-{\n\
-\  wnd=open(url, name, features, replace);\n\
-\  if (wnd.opener == null) wnd.opener=self;\n\
-}\n
-
-# Open a popup window
-popupSupportOnClick=netui_popup(''{0}'',''{1}'',''{2}'',{3});return false;
+popupSupportPopupWindow=\
+window_{0} = null;\n\
+function {0}(url, name, features, replace)\n\
+'{'\n\
+\  if (window_{0} != null && ! window_{0}.closed)\n\
+\  '{'\n\
+\    window_{0}.focus();\n\
+\    return;\n\
+\  '}'\n\
+\  window_{0}=open(url, name, features, replace);\n\
+\  if (window_{0}.opener == null) window_{0}.opener=self;\n\
+'}'\n
 
 # Open a popup window using a custom function
-popupSupportOnClickCustom={0}();return false;
+popupSupportOnClick={0}(''{1}'',''{2}'',''{3}'',{4});return false;
 
-popupSupportOnPopupDone=\
+popupDone=\
 function {0}(map)\n\
 '{'\n\
 \  for (var i in map)\n\

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/mockportal/MockPortalUrlRewriter.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/mockportal/MockPortalUrlRewriter.java?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/mockportal/MockPortalUrlRewriter.java
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/mockportal/MockPortalUrlRewriter.java
 Thu Feb 24 18:37:33 2005
@@ -63,14 +63,25 @@
                         ret.append( '&' );
                         String queryItem = tok.nextToken();
                         int eq = queryItem.indexOf( '=' );
+                        String paramName;
                         if ( eq != -1 )
                         {
-                            ret.append( rewriteName( servletContext, request, 
queryItem.substring( 0, eq ) ) );
+                            paramName = queryItem.substring( 0, eq );
+                            ret.append( rewriteName( servletContext, request, 
paramName ) );
                             ret.append( '=' ).append( queryItem.substring( eq 
+ 1 ) );
                         }
                         else
                         {
-                            ret.append( rewriteName( servletContext, request, 
queryItem ) );
+                            paramName = queryItem;
+                            ret.append( rewriteName( servletContext, request, 
paramName ) );
+                        }
+                        
+                        //
+                        // If there's a jpfScopeID param on the URL, then 
return the URL untouched.
+                        //
+                        if ( paramName.equals( 
ScopedServletUtils.SCOPE_ID_PARAM ) )
+                        {
+                            return url;
                         }
                     }
                     

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/MockPortal.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/MockPortal.jsp?view=auto&rev=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/MockPortal.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/MockPortal.jsp
 Thu Feb 24 18:37:33 2005
@@ -0,0 +1,18 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="mockportal.tld" prefix="mp" %>
+
+<html>
+<head>
+<title>Mock Portal (/mockportal)</title>
+</head>
+
+<h3>Mock Portal (/mockportal)</h3>
+<body>
+
+    <mp:mockPortal>
+        <mp:mockPortlet portletID="portletA" 
pageFlowURI="/miniTests/updateFormFromNestedPopup/Controller.jpf" 
verbose="false" />
+        <mp:mockPortlet portletID="portletB" 
pageFlowURI="/miniTests/updateFormFromNestedPopup/Controller.jpf" 
verbose="false" />
+    </mp:mockPortal>
+
+</body>
+</html>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/MockPortal.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
 Thu Feb 24 18:37:33 2005
@@ -1,8 +1,13 @@
 <%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ page import="org.apache.beehive.netui.pageflow.scoping.ScopedRequest"%>
+<%@ page 
import="org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils"%>
 <%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
 <%@ taglib prefix="netui-data" 
uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
 <%@ taglib prefix="netui-template" 
uri="http://beehive.apache.org/netui/tags-template-1.0"%>
 
+<%
+    ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( request );
+%>
 <netui:html>
     <head>
         <netui:base/>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/popup/index.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/popup/index.jsp?view=diff&r1=155290&r2=155291
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/popup/index.jsp 
(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/popup/index.jsp 
Thu Feb 24 18:37:33 2005
@@ -23,6 +23,15 @@
             <netui:configurePopup width="200" height="100"/>
         </netui:imageAnchor>
 
+        <br/>
+        area: 
+        <img src="cool.gif" usemap="#map1"/>
+        <map name="map1">
+            <netui:area shape="rect" coords="0,0,25,25" action="goNested"  
popup="true">
+                <netui:configurePopup width="200" height="100"/>
+            </netui:area>
+        </map>
+
         <netui:form action="goNested">
             button (uses form's action):
             <netui:button value="goNested" popup="true">

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
 Thu Feb 24 18:37:33 2005
@@ -4434,7 +4434,21 @@
             <feature>Scoping</feature>
          </features>
       </test>
-       <test>
+      <test>
+         <name>MockPortalPopupWindows</name>
+         <description>Test of popup window support (really, a test of 
generating the right javascript) in MockPortal.</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>bvt.struts11</category>
+            <category>mockPortal</category>
+         </categories>
+         <features>
+            <feature>Scoping</feature>
+            <feature>Popup</feature>
+         </features>
+      </test>
+      <test>
          <name>MockPortalScopingTest</name>
          <description>Tests 'jpfScopeID' parameter under our simulated portal. 
 This parameter causes the targeted page flow to live in a given session 
'scope', which is the same scope used by portlets.</description>
          <webapp>coreWeb</webapp>
@@ -5142,7 +5156,7 @@
       </test>
       <test>
          <name>PopupAttribute</name>
-         <description>Test of the 'popup' attribute on anchor, imageAnchor, 
and button.</description>
+         <description>Test of the 'popup' attribute on anchor, imageAnchor, 
area, and button.</description>
          <webapp>coreWeb</webapp>
          <categories>
             <category>bvt</category>
@@ -7009,7 +7023,6 @@
             <feature>Nesting</feature>
             <feature>Form</feature>
             <feature>Popup</feature>
-            <feature>Validation</feature>
          </features>
       </test>
       <test>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortal.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortal.xml?view=diff&r1=155290&r2=155291
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortal.xml
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortal.xml
 Thu Feb 24 18:37:33 2005
@@ -102,7 +102,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestAaltAction=submit&smokeTestA_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestA{pageFlow.data}" id="tb">
+            data: <input type="text" name="smokeTestA{pageFlow.data}" 
id="smokeTestA.tb">
             <input type="submit" value="submit">
         </form>
 
@@ -117,14 +117,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestA{pageFlow.data}"
+netui_names.smokeTestA__tb="smokeTestA{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestA{pageFlow.data}"
+netui_tagIdNameMap.smokeTestA___tb="smokeTestA{pageFlow.data}"
 
 
 // method which will return a real id for a tagId,
@@ -213,7 +213,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestBaltAction=submit&smokeTestB_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestB{pageFlow.data}" id="tb">
+            data: <input type="text" name="smokeTestB{pageFlow.data}" 
id="smokeTestB.tb">
             <input type="submit" value="submit">
         </form>
 
@@ -228,14 +228,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestB{pageFlow.data}"
+netui_names.smokeTestB__tb="smokeTestB{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestB{pageFlow.data}"
+netui_tagIdNameMap.smokeTestB___tb="smokeTestB{pageFlow.data}"
 
 -->
 </script>
@@ -405,7 +405,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestBaltAction=submit&smokeTestB_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestB{pageFlow.data}" id="tb">
+            data: <input type="text" name="smokeTestB{pageFlow.data}" 
id="smokeTestB.tb">
             <input type="submit" value="submit">
         </form>
 
@@ -420,14 +420,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestB{pageFlow.data}"
+netui_names.smokeTestB__tb="smokeTestB{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestB{pageFlow.data}"
+netui_tagIdNameMap.smokeTestB___tb="smokeTestB{pageFlow.data}"
 
 
 // method which will return a real id for a tagId,
@@ -779,7 +779,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestAaltAction=submit&smokeTestA_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestA{pageFlow.data}" id="tb" 
value="aaa">
+            data: <input type="text" name="smokeTestA{pageFlow.data}" 
id="smokeTestA.tb" value="aaa">
             <input type="submit" value="submit">
         </form>
 
@@ -794,14 +794,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestA{pageFlow.data}"
+netui_names.smokeTestA__tb="smokeTestA{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestA{pageFlow.data}"
+netui_tagIdNameMap.smokeTestA___tb="smokeTestA{pageFlow.data}"
 
 
 // method which will return a real id for a tagId,
@@ -1207,7 +1207,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestBaltAction=submit&smokeTestB_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestB{pageFlow.data}" id="tb" 
value="bbb">
+            data: <input type="text" name="smokeTestB{pageFlow.data}" 
id="smokeTestB.tb" value="bbb">
             <input type="submit" value="submit">
         </form>
 
@@ -1222,14 +1222,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestB{pageFlow.data}"
+netui_names.smokeTestB__tb="smokeTestB{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestB{pageFlow.data}"
+netui_tagIdNameMap.smokeTestB___tb="smokeTestB{pageFlow.data}"
 
 
 // method which will return a real id for a tagId,
@@ -1409,7 +1409,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestAaltAction=submit&smokeTestA_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestA{pageFlow.data}" id="tb" 
value="aaa">
+            data: <input type="text" name="smokeTestA{pageFlow.data}" 
id="smokeTestA.tb" value="aaa">
             <input type="submit" value="submit">
         </form>
 
@@ -1424,14 +1424,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestA{pageFlow.data}"
+netui_names.smokeTestA__tb="smokeTestA{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestA{pageFlow.data}"
+netui_tagIdNameMap.smokeTestA___tb="smokeTestA{pageFlow.data}"
 
 
 // method which will return a real id for a tagId,
@@ -1517,7 +1517,7 @@
         <h3>Mock Portal Smoke Test</h3>
         
         <form 
action="/coreWeb/mockportal/MockPortal.jsp?smokeTestBaltAction=submit&smokeTestB_submit=true"
 method="post">
-            data: <input type="text" name="smokeTestB{pageFlow.data}" id="tb" 
value="bbb">
+            data: <input type="text" name="smokeTestB{pageFlow.data}" 
id="smokeTestB.tb" value="bbb">
             <input type="submit" value="submit">
         </form>
 
@@ -1532,14 +1532,14 @@
 // to the real id written into the HTML
 if (netui_names == null)
    var netui_names = new Object();
-netui_names.tb="smokeTestB{pageFlow.data}"
+netui_names.smokeTestB__tb="smokeTestB{pageFlow.data}"
 
 
 // Build the netui_names table to map the tagId attributes
 // to the real id written into the HTML
 if (netui_tagIdNameMap == null)
    var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.tb="smokeTestB{pageFlow.data}"
+netui_tagIdNameMap.smokeTestB___tb="smokeTestB{pageFlow.data}"
 
 -->
 </script>
@@ -1564,4 +1564,4 @@
    <ses:testCount>7</ses:testCount>
    <ses:passedCount>2</ses:passedCount>
    <ses:failedCount>5</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>


Reply via email to