You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/01/30 13:38:18 UTC

svn commit: r373502 - in /myfaces: commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/ tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/ tomahawk/trunk/examples/simple/src/main/webapp/

Author: mmarinschek
Date: Mon Jan 30 04:38:04 2006
New Revision: 373502

URL: http://svn.apache.org/viewcvs?rev=373502&view=rev
Log:
always returned new HashSet() instead of parameters out of DummyFormUtils

Modified:
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DummyFormUtils.java
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/jscookmenu.jsp

Modified: myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DummyFormUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DummyFormUtils.java?rev=373502&r1=373501&r2=373502&view=diff
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DummyFormUtils.java (original)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DummyFormUtils.java Mon Jan 30 04:38:04 2006
@@ -15,22 +15,20 @@
  */
 package org.apache.myfaces.renderkit.html.util;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.renderkit.RendererUtils;
 import org.apache.myfaces.renderkit.html.HTML;
 import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import javax.faces.application.StateManager;
 import javax.faces.application.ViewHandler;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
 import java.util.HashSet;
+import java.util.Set;
 
 /**
  * Many JSF components can be used without an enclosing h:form. In this
@@ -49,9 +47,6 @@
 {
     private static final Log log = LogFactory.getLog(DummyFormUtils.class);
 
-    private static final String DUMMY_FORM_RESPONSE_WRITER_WRAPPER_REQ_PARAM
-            = DummyFormUtils.class.getName() + ".INSTANCE";
-
     public static final String DUMMY_FORM_NAME = "linkDummyForm";
     private static final String DUMMY_FORM_ID = "linkDummyForm";
 
@@ -90,7 +85,7 @@
     /**
      * Checks if the DummyFormRequestInfo is already in the request map.
      * @param facesContext
-     * @return
+     * @return boolean true, if dummy form is to be written
      */
     public static boolean isWriteDummyForm(FacesContext facesContext)
     {
@@ -123,7 +118,7 @@
         if (isWriteDummyForm(facesContext))
         {
             DummyFormRequestInfo dummyFormInfo = (DummyFormRequestInfo) facesContext.getExternalContext().getRequestMap().get(DUMMY_FORM_INFO);
-            dummyFormInfo.getDummyFormParams();
+            return dummyFormInfo.getDummyFormParams();
         }
 
         return new HashSet();

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java?rev=373502&r1=373501&r2=373502&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java Mon Jan 30 04:38:04 2006
@@ -292,12 +292,12 @@
                     if (uiNavMenuItem != null && uiNavMenuItem.getItemValue() != null)
                     {
                         actionStr.append(';');
-                        actionStr.append(item.getValue());
+                        actionStr.append(JavascriptUtils.encodeString(item.getValue()==null?null:item.getValue().toString()));
                     }
                     else if (item.getValue() != null)
                     {
                         actionStr.append(';');
-                        actionStr.append(item.getValue());
+                        actionStr.append(JavascriptUtils.encodeString(item.getValue()==null?null:item.getValue().toString()));
                     }
                 }
                 if (item.getAction() != null)

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/jscookmenu.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/jscookmenu.jsp?rev=373502&r1=373501&r2=373502&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/jscookmenu.jsp (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/jscookmenu.jsp Mon Jan 30 04:38:04 2006
@@ -1,5 +1,6 @@
 
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
 <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
 
 <html>
@@ -29,7 +30,8 @@
 	<f:loadBundle
 		basename="org.apache.myfaces.examples.resource.example_messages"
 		var="example_messages" />
-	<t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="css/jscookmenu">
+    <h:form>
+    <t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="css/jscookmenu">
 		<%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
              Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
              respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
@@ -99,6 +101,8 @@
     <t:jscookMenu id="menu2" layout="hbr" theme="ThemeOffice" styleLocation="css/jscookmenu">
         <t:navigationMenuItems id="navitems" value="#{navigationMenu.panelNavigationItems}" />
     </t:jscookMenu>
+
+    </h:form>
 
 </f:view>
 <%@include file="inc/page_footer.jsp"%>