Author: rich
Date: Fri Feb 11 11:11:24 2005
New Revision: 153441

URL: http://svn.apache.org/viewcvs?view=rev&rev=153441
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-283 : onPopupDone in 
configurePopup tag not calling JS function

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


Modified:
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java?view=diff&r1=153440&r2=153441
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
 Fri Feb 11 11:11:24 2005
@@ -110,7 +110,6 @@
             // remove the following line:
             addForward( new ForwardModel( "_auto", "", this ) );
             
-            
             GenExceptionModel.addCatches( mca.getCatches(), this, _jclass, 
this, this );
             addTilesDefinitionsConfigs( mca.getTilesDefinitionsConfigs() );
             setAdditionalValidatorConfigs( mca.getCustomValidatorConfigs() );

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=153440&r2=153441
==============================================================================
--- 
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
 Fri Feb 11 11:11:24 2005
@@ -17,7 +17,6 @@
 */
 package org.apache.beehive.netui.compiler.grammar;
 
-import org.apache.beehive.netui.compiler.AnnotationGrammar;
 import org.apache.beehive.netui.compiler.RuntimeVersionChecker;
 import org.apache.beehive.netui.compiler.AnnotationMemberType;
 import org.apache.beehive.netui.compiler.FlowControllerInfo;
@@ -32,7 +31,6 @@
 
 import static org.apache.beehive.netui.compiler.JpfLanguageConstants.*;
 
-import java.util.List;
 import java.util.Collection;
 
 
@@ -87,7 +85,7 @@
     private static class SimpleActionForwardGrammar
             extends ForwardGrammar
     {
-        private static String[][] REQUIRED_ATTRS =
+        private static String[][] REQUIRED_SIMPLEACTION_ATTRS =
                 {
                     { PATH_ATTR, TILES_DEFINITION_ATTR, RETURN_ACTION_ATTR, 
NAVIGATE_TO_ATTR, ACTION_ATTR }
                 };
@@ -101,7 +99,7 @@
 
         public String[][] getRequiredAttrs()
         {
-            return REQUIRED_ATTRS;
+            return REQUIRED_SIMPLEACTION_ATTRS;
         }
 
         protected AnnotationMemberType getNameType()
@@ -136,11 +134,13 @@
             
             for ( AnnotationMirror forwardAnn : forwards )
             {
-                if ( forwardName.equals( CompilerUtils.getString( forwardAnn, 
NAME_ATTR, true ) ) )
-                {
-                    return null;
-                }
+                if ( forwardName.equals( CompilerUtils.getString( forwardAnn, 
NAME_ATTR, true ) ) ) return null;
             }
+            
+            // TODO: this is a *temporary* workaround for 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006.
+            // When this bug is fixed, we can uncomment the @Jpf.Controller 
annotation in FlowController.java, and
+            // remove the following line:
+            if ( forwardName.equals( "_auto" ) ) return null;
             
             addError( member, "error.unresolvable-global-forward", forwardName 
);
             return null;

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=153440&r2=153441
==============================================================================
--- 
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
 Fri Feb 11 11:11:24 2005
@@ -39,6 +39,7 @@
     private HashMap _features;
     private boolean _replace = false;
     private String _onPopupDone;
+    private String _defaultOnPopupDone;
     private String _popupFunc;
 
     public void setName(String name)
@@ -147,10 +148,9 @@
             throws JspException
     {
         
urlParams.addParameter(InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM, 
VIEW_RENDERER_CLASS_NAME, null);
-        if (_onPopupDone == null) {
-            _onPopupDone = ON_POPUP_DONE_FUNC + getNextId(request);
-        }
-        
urlParams.addParameter(ReturnActionViewRenderer.getCallbackParamName(), 
_onPopupDone, null);
+        _defaultOnPopupDone = ON_POPUP_DONE_FUNC + getNextId(request);
+        String onPopupDone = _onPopupDone != null ? _onPopupDone : 
_defaultOnPopupDone;
+        
urlParams.addParameter(ReturnActionViewRenderer.getCallbackParamName(), 
onPopupDone, null);
     }
 
     /**
@@ -176,8 +176,8 @@
         srs.writeFeature(scriptReporter, results, 
CoreScriptFeature.POPUP_FUNC, true, false, null);
 
         // Write the callback that's triggered when the popup window is 
closing.
-        assert (_onPopupDone != null);   // addParams() should ensure that 
this isn't null
-        srs.writeFeature(scriptReporter, results, "popupSupportOnPopupDone", 
new Object[]{_onPopupDone});
+        assert (_defaultOnPopupDone != null);   // addParams() should ensure 
that this isn't null
+        srs.writeFeature(scriptReporter, results, "popupSupportOnPopupDone", 
new Object[]{_defaultOnPopupDone});
     }
 
     private void putFeature(String featureName, boolean val)


Reply via email to