You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jl...@apache.org on 2006/04/07 15:25:13 UTC

svn commit: r392287 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/fisheye/HtmlFishEyeNavigationMenuRenderer.java

Author: jlust
Date: Fri Apr  7 06:24:59 2006
New Revision: 392287

URL: http://svn.apache.org/viewcvs?rev=392287&view=rev
Log:
added decode method to the FishEye renderer

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/fisheye/HtmlFishEyeNavigationMenuRenderer.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/fisheye/HtmlFishEyeNavigationMenuRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/fisheye/HtmlFishEyeNavigationMenuRenderer.java?rev=392287&r1=392286&r2=392287&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/fisheye/HtmlFishEyeNavigationMenuRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/fisheye/HtmlFishEyeNavigationMenuRenderer.java Fri Apr  7 06:24:59 2006
@@ -23,6 +23,7 @@
 import javax.faces.component.UIForm;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
+import javax.faces.event.ActionEvent;
 
 import org.apache.myfaces.custom.dojo.DojoUtils;
 import org.apache.myfaces.custom.navmenu.UINavigationMenuItem;
@@ -58,6 +59,24 @@
     public static final String RENDERER_TYPE = "org.apache.myfaces.FishEyeList";
 
     /**
+     * @see javax.faces.render.Renderer#decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+     */
+    public void decode(FacesContext context, UIComponent component)
+    {
+        String reqValue = (String) context.getExternalContext()
+                .getRequestParameterMap().get(
+                        HtmlRendererUtils
+                                .getHiddenCommandLinkFieldName(findNestingForm(
+                                        component, context).getFormName()));
+        UIComponent source = context.getViewRoot().findComponent(reqValue);
+        if (source instanceof UINavigationMenuItem)
+        {
+            UINavigationMenuItem item = (UINavigationMenuItem) source;
+            item.queueEvent(new ActionEvent(item));
+        }
+    }
+
+    /**
      * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
      */
     public void encodeBegin(FacesContext context, UIComponent component)
@@ -203,6 +222,7 @@
         writer.writeAttribute(HTML.ONCLICK_ATTR, onClick.toString(), null);
         writer.writeAttribute(CAPTION_ATTR, item.getItemLabel(), null);
         writer.writeAttribute(ICON_SRC_ATTR, item.getIcon(), null);
+        writer.writeAttribute(HTML.ID_ATTR, clientId, null);
         writer.endElement(HTML.DIV_ELEM);
     }