myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r632550 - in /myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom: aliasbean/ collapsiblepanel/ navmenu/jscookmenu/
Date Sat, 01 Mar 2008 04:56:02 GMT
Author: lu4242
Date: Fri Feb 29 20:56:01 2008
New Revision: 632550

URL: http://svn.apache.org/viewvc?rev=632550&view=rev
Log:
jscookmenu error resolved, collapsiblepanel error resolved and aliasbean error id resolved

Modified:
    myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTag.java
    myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelTagBase.java
    myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
    myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodBindingToMethodExpression.java
    myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodExpressionToMethodBinding.java

Modified: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTag.java?rev=632550&r1=632549&r2=632550&view=diff
==============================================================================
--- myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTag.java
(original)
+++ myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTag.java
Fri Feb 29 20:56:01 2008
@@ -86,13 +86,6 @@
         return null;
     }
 
-    private java.lang.String _id;
-
-    public void setId(java.lang.String id)
-    {
-        _id = id;
-    }
-
     private ValueExpression _alias;
 
     public void setAlias(ValueExpression alias)
@@ -119,10 +112,6 @@
 
         super.setProperties(component);
 
-        if (_id != null)
-        {
-            comp.getAttributes().put("id", _id);
-        }
         if (_alias != null)
         {
             comp.setValueExpression("alias", _alias);
@@ -137,7 +126,6 @@
     public void release()
     {
         super.release();
-        _id = null;
         _alias = null;
         _value = null;
     }

Modified: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelTagBase.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelTagBase.java?rev=632550&r1=632549&r2=632550&view=diff
==============================================================================
--- myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelTagBase.java
(original)
+++ myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelTagBase.java
Fri Feb 29 20:56:01 2008
@@ -20,16 +20,13 @@
 
 import java.util.List;
 
-import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlInputTextTag;
-
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-import javax.servlet.jsp.tagext.BodyTag;
-import javax.servlet.jsp.tagext.BodyContent;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspWriter;
-import javax.faces.webapp.UIComponentClassicTagBase;
 import javax.faces.webapp.UIComponentELTag;
+import javax.servlet.jsp.JspException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * 
@@ -39,8 +36,17 @@
 public abstract class HtmlCollapsiblePanelTagBase
         extends UIComponentELTag 
 {
-    //private static final Log log = LogFactory.getLog(HtmlCollapsiblePanelTag.class);
+    private static final Log log = LogFactory.getLog(HtmlCollapsiblePanelTag.class);
 
+    public int doStartTag() throws JspException
+    {
+        Thread.dumpStack();
+        System.out.println("doStartTag id:"+this.getId());
+        log.info("doStartTag id:"+this.getId());        
+        return super.doStartTag();
+        
+    }
+    
     public void release() {
         super.release();
         //bodyContent = null;
@@ -54,11 +60,18 @@
     
     public void setId(String id){
         Thread.dumpStack();
+        System.out.println("setId:"+id);
+        log.info("setId:"+id);
         super.setId(id);
+        
     }
         
     protected UIComponent createComponent(FacesContext context, String newId) throws JspException
     {
+        System.out.println("newId:"+newId);
+        System.out.println("getId:"+this.getId());
+        System.out.println("getJspId:"+this.getJspId());
+        
         UIComponent instance = super.createComponent(context, newId);
         
         //TODO: This hack avoid duplication on component tree when
@@ -68,8 +81,8 @@
         //The only way that I (lu4242) founded to avoid this 
         //is let the component create and check the id
         //after the component is created. 
-        UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
-        
+        //UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
+        /*
         if (parentTag != null){
             UIComponent parent = parentTag.getComponentInstance();
             if (parent != null){
@@ -80,7 +93,7 @@
                 }            
             }
         }
-        
+        */
         return instance;
     }
     

Modified: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java?rev=632550&r1=632549&r2=632550&view=diff
==============================================================================
--- myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
(original)
+++ myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
Fri Feb 29 20:56:01 2008
@@ -44,8 +44,10 @@
 import javax.el.ValueExpression;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 
 /**
@@ -62,6 +64,7 @@
 
     private static final String JSCOOK_ACTION_PARAM = "jscook_action";
     private static final Class[] ACTION_LISTENER_ARGS = {ActionEvent.class};
+    private static final Class[] ACTION_ARGS = {};
 
     private static final Map builtInThemes = new java.util.HashMap();
 
@@ -95,7 +98,7 @@
                         if (NavigationMenuUtils.isValueReference(action)) {
                             //mb = context.getApplication().createMethodBinding(action, null);
                             mb = context.getApplication().getExpressionFactory().createMethodExpression(
-                                    context.getELContext(), action, String.class, null);
+                                    context.getELContext(), action, String.class, ACTION_ARGS);
                         }
                         else {
                             mb = new _MethodBindingToMethodExpression(new SimpleActionMethodBinding(action));
@@ -181,12 +184,23 @@
                 writer.write(JSCOOK_ACTION_PARAM);
                 writer.write("\" />");
             }
-            else {
-                //writer.write("<input type=\"hidden\" name=\"");
-                //writer.write(JSCOOK_ACTION_PARAM);
-                //writer.write("\" />");
-                //log.info("Adding JSCOOK_ACTION_PARAM");
-                HtmlFormRendererBase.addHiddenCommandParameter(context, parentFormInfo.getForm(),
JSCOOK_ACTION_PARAM);
+            else {                
+                //In this part we need to render the hidden
+                //input field here, but we have to ensure that
+                //this part is only rendered once per form
+                String hiddenKey = JSCOOK_ACTION_PARAM+"_"+parentFormInfo.getForm().getClientId(context);
+                
+                String hiddenAction = (String) context.getExternalContext().getRequestMap().get(hiddenKey);
+                
+                if (hiddenAction == null){
+                    context.getExternalContext().getRequestMap().put(hiddenKey, JSCOOK_ACTION_PARAM);
+                    writer.write("<input type=\"hidden\" name=\"");
+                    writer.write(JSCOOK_ACTION_PARAM);
+                    writer.write("\" />");                    
+                }
+                
+                //log.info("Adding JSCOOK_ACTION_PARAM");      
+                //HtmlFormRendererBase.addHiddenCommandParameter(context, parentFormInfo.getForm(),
JSCOOK_ACTION_PARAM);
             }
 
             //}

Modified: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodBindingToMethodExpression.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodBindingToMethodExpression.java?rev=632550&r1=632549&r2=632550&view=diff
==============================================================================
--- myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodBindingToMethodExpression.java
(original)
+++ myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodBindingToMethodExpression.java
Fri Feb 29 20:56:01 2008
@@ -37,7 +37,7 @@
  * @author Stan Silvert
  */
 @SuppressWarnings("deprecation")
-class _MethodBindingToMethodExpression extends MethodExpression implements StateHolder
+public class _MethodBindingToMethodExpression extends MethodExpression implements StateHolder
 {
     private static final Class[] EXPECTED_TYPES = new Class[] { MethodBinding.class, StateHolder.class
};
 

Modified: myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodExpressionToMethodBinding.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodExpressionToMethodBinding.java?rev=632550&r1=632549&r2=632550&view=diff
==============================================================================
--- myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodExpressionToMethodBinding.java
(original)
+++ myfaces/tomahawk/branches/1_2_0/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/_MethodExpressionToMethodBinding.java
Fri Feb 29 20:56:01 2008
@@ -35,7 +35,7 @@
  * @author Stan Silvert
  * @see org.apache.myfaces.el.convert.MethodExpressionToMethodBinding
  */
-class _MethodExpressionToMethodBinding extends MethodBinding implements StateHolder {
+public class _MethodExpressionToMethodBinding extends MethodBinding implements StateHolder
{
     
     private MethodExpression methodExpression;
     



Mime
View raw message