You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2006/03/03 12:37:08 UTC

svn commit: r382765 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java

Author: imario
Date: Fri Mar  3 03:37:05 2006
New Revision: 382765

URL: http://svn.apache.org/viewcvs?rev=382765&view=rev
Log:
render script at first, subsequent scripts require some constants

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java

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=382765&r1=382764&r2=382765&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 Fri Mar  3 03:37:05 2006
@@ -388,18 +388,24 @@
         writer.append(tempObj.toString());
     }
 
-    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
+    public void encodeBegin(FacesContext context, UIComponent component) throws IOException
     {
-        RendererUtils.checkParamValidity(context, component, HtmlCommandJSCookMenu.class);
         HtmlCommandJSCookMenu menu = (HtmlCommandJSCookMenu)component;
-
         String theme = menu.getTheme();
         if (theme == null) {
                 // should never happen; theme is a required attribute in the jsp tag definition
             throw new IllegalArgumentException("theme name is mandatory for a jscookmenu.");
         }
+        
+    	addResourcesToHeader(theme,menu,context);
+    }
+
+    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
+    {
+        RendererUtils.checkParamValidity(context, component, HtmlCommandJSCookMenu.class);
+        HtmlCommandJSCookMenu menu = (HtmlCommandJSCookMenu)component;
+        String theme = menu.getTheme();
 
-        addResourcesToHeader(theme,menu,context);
 
         ResponseWriter writer = context.getResponseWriter();