svn commit: r608445 - in /ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget: html/HtmlMenuRenderer.java menu/ModelMenu.java menu/ModelMenuItem.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r608445 - in /ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget: html/HtmlMenuRenderer.java menu/ModelMenu.java menu/ModelMenuItem.java

jleroux@apache.org
Author: jleroux
Date: Thu Jan  3 02:55:51 2008
New Revision: 608445

URL: http://svn.apache.org/viewvc?rev=608445&view=rev
Log:
Merged by hand from 607999

Modified:
    ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
    ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
    ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java

Modified: ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java?rev=608445&r1=608444&r2=608445&view=diff
==============================================================================
--- ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java (original)
+++ ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java Thu Jan  3 02:55:51 2008
@@ -156,7 +156,7 @@
 
         String style = null;
         
-        if (menuItem.isSelected(context)) {
+        if (menuItem.isSelected()) {
             style = menuItem.getSelectedStyle();
             if (UtilValidate.isEmpty(style)) {
                 style = "selected";

Modified: ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java?rev=608445&r1=608444&r2=608445&view=diff
==============================================================================
--- ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java (original)
+++ ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java Thu Jan  3 02:55:51 2008
@@ -326,6 +326,9 @@
         // render formatting wrapper open
         menuStringRenderer.renderFormatSimpleWrapperOpen(buffer, context, this);
 
+        // Set the selected menu item from the context
+        this.setCurrentMenuItemName(context);
+
             //Debug.logInfo("in ModelMenu, menuItemList:" + menuItemList, module);
         // render each menuItem row, except hidden & ignored rows
         //menuStringRenderer.renderFormatSimpleWrapperRows(buffer, context, this);
@@ -538,6 +541,12 @@
         this.currentMenuItemName = string;
     }
 
+    /**
+     * @param context Map containing the menu context
+     */
+    public void setCurrentMenuItemName(Map context) {
+        this.currentMenuItemName = this.getSelectedMenuItemContextFieldName(context);
+    }
 
     /**
      * @param string

Modified: ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java?rev=608445&r1=608444&r2=608445&view=diff
==============================================================================
--- ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java (original)
+++ ofbiz/branches/release4.0/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java Thu Jan  3 02:55:51 2008
@@ -569,9 +569,14 @@
        return this.link;
     }
     
+    /** @deprecated use isSelected() */
     public boolean isSelected(Map context) {
         String currentMenuItemName = modelMenu.getSelectedMenuItemContextFieldName(context);
         return currentMenuItemName != null && currentMenuItemName.equals(this.name);
+    }
+
+    public boolean isSelected() {
+        return modelMenu.getCurrentMenuItemName() != null && modelMenu.getCurrentMenuItemName().equals(this.name);
     }
 
     public static class Link {