Author: nbelaevski
Date: 2010-12-13 14:09:26 -0500 (Mon, 13 Dec 2010)
New Revision: 20542
Modified:
trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
Log:
https://issues.jboss.org/browse/RF-9463
Modified: trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-12-13 18:46:54
UTC (rev 20541)
+++ trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-12-13 19:09:26
UTC (rev 20542)
@@ -4,6 +4,7 @@
* @author akolonitsky
* @since Oct 19, 2010
*/
+//TODO nick - having separate enum for each component is a bad idea
public enum PanelMenuMode {
ajax,
server,
Modified: trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java 2010-12-13
18:46:54 UTC (rev 20541)
+++ trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -33,6 +33,9 @@
*/
public class PanelToggleEvent extends FacesEvent {
+ private static final long serialVersionUID = 852945229559247489L;
+
+ //TODO nick - why not primitive boolean here?
private final Boolean isExpanded;
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -23,11 +23,6 @@
package org.richfaces.component;
-import org.richfaces.PanelMenuMode;
-import org.richfaces.event.ItemChangeEvent;
-import org.richfaces.event.ItemChangeListener;
-import org.richfaces.event.ItemChangeSource;
-
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
@@ -36,6 +31,11 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.ItemChangeListener;
+import org.richfaces.event.ItemChangeSource;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -61,6 +61,8 @@
public void processDecodes(FacesContext context) {
super.processDecodes(context);
+ //TODO nick - is component immediate = true only?
+ //TODO nick - validate should be executed in context of component, i.e. when
'component' EL variable is set
executeValidate(context);
}
@@ -78,6 +80,7 @@
String previous = (String) getValue();
setActiveItem(activeItem);
setSubmittedActiveItem(null);
+
if (previous == null || !previous.equalsIgnoreCase(activeItem)) {
queueEvent(new ItemChangeEvent(this, previous, activeItem));
}
@@ -91,6 +94,7 @@
throw e;
}
+ //TODO nick - where is 'valid' attribute set?
if (!isValid()) {
context.validationFailed();
context.renderResponse();
@@ -120,8 +124,10 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
+ //TODO nick - check for (isBypassUpdates() || isImmediate()) can be removed
if (event instanceof ItemChangeEvent
&& (isBypassUpdates() || isImmediate())) {
+ //TODO nick - use getFacesContext() instead
FacesContext.getCurrentInstance().renderResponse();
}
}
@@ -132,6 +138,7 @@
return this.submittedActiveItem;
}
+ //TODO nick - change argument to String
public void setSubmittedActiveItem(Object submittedValue) {
this.submittedActiveItem = String.valueOf(submittedValue);
}
@@ -148,6 +155,7 @@
return (String) getValue();
}
+ //TODO nick - where is EL-expression updated?
public void setActiveItem(String value) {
setValue(value);
}
@@ -216,6 +224,7 @@
return (AbstractPanelMenuItem) comp;
}
+ //TODO nick - what if panel menu is nested?
for (UIComponent item : comp.getChildren()) {
AbstractPanelMenuItem resItem = getItem(itemName, item);
if (resItem != null) {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -23,14 +23,14 @@
package org.richfaces.component;
-import org.richfaces.event.ItemChangeEvent;
-import org.richfaces.event.PanelToggleEvent;
-
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.PanelToggleEvent;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -60,6 +60,7 @@
public void processDecodes(FacesContext context) {
super.processDecodes(context);
+ //TODO nick - is component immediate==true always?
executeValidate(context);
}
@@ -90,6 +91,7 @@
throw e;
}
+ //TODO nick - isValid()/setValid() is not called anywhere
if (!isValid()) {
context.validationFailed();
context.renderResponse();
@@ -169,5 +171,6 @@
public abstract boolean isBubbleSelection();
+ //TODO nick - this should be MethodExpression
public abstract String getChangeExpandListener();
}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -23,23 +23,25 @@
package org.richfaces.component;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+
import org.richfaces.PanelMenuMode;
import org.richfaces.event.ItemChangeListener;
import org.richfaces.event.ItemChangeSource;
-import javax.faces.component.UICommand;
-import javax.faces.component.UIComponent;
-
/**
* @author akolonitsky
* @since 2010-10-25
*/
+//TODO nick - use org.richfaces.component.AbstractActionComponent as super class
public abstract class AbstractPanelMenuItem extends UICommand implements
ItemChangeSource{
public static final String COMPONENT_TYPE = "org.richfaces.PanelMenuItem";
public static final String COMPONENT_FAMILY =
"org.richfaces.PanelMenuItem";
+ //TODO nick - move this enum to renderkit package
public enum Icons {
none("rf-pm-none"),
disc("rf-pm-disc"),
@@ -59,6 +61,7 @@
this.cssClass = cssClass;
}
+ //TODO nick - should this become getCssClass()?
public String cssClass() {
return cssClass;
}
@@ -72,6 +75,7 @@
return getParentItem() instanceof AbstractPanelMenu;
}
+ //TODO nick - this can be replaced with ComponentIterators.parents(UIComponent) +
Iterators.find(...)
public AbstractPanelMenu getPanelMenu() { // TODO refactor
UIComponent parentItem = getParent();
while (parentItem != null) {
@@ -85,6 +89,7 @@
return null;
}
+ //TODO nick - this can be replaced with ComponentIterators.parents(UIComponent) +
Iterators.find(...)
public UIComponent getParentItem() {
UIComponent parentItem = getParent();
while (parentItem != null) {
@@ -126,6 +131,7 @@
// ------------------------------------------------ Event Processing Methods
+ //TODO nick - it seems these listeners are never triggered
public void addItemChangeListener(ItemChangeListener listener) {
addFacesListener(listener);
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-12-13
18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -29,6 +29,7 @@
* @author akolonitsky
* @since 2010-11-29
*/
+//TODO nick - this class should be generated by CDK
public class UIPanelMenu extends AbstractPanelMenu {
public enum PropertyKeys {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -29,6 +29,7 @@
* @author akolonitsky
* @since 2010-10-25
*/
+//TODO nick - this class should be generated by CDK
public class UIPanelMenuGroup extends AbstractPanelMenuGroup {
public enum PropertyKeys {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -29,6 +29,7 @@
* @author akolonitsky
* @since 2010-11-29
*/
+//TODO nick - this class should be generated by CDK
public class UIPanelMenuItem extends AbstractPanelMenuItem {
public enum PropertyKeys {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -23,6 +23,17 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractPanelMenuGroup;
@@ -31,16 +42,6 @@
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
/**
* @author akolonitsky
* @since 2010-10-25
@@ -54,6 +55,7 @@
public static final String BEFORE_EXPAND = "beforeexpand";
public static final String BEFORE_SWITCH = "beforeswitch";
private static final String CSS_CLASS_PREFIX = "rf-pm-gr";
+ //TODO nick - shouldn't this be rf-pm-gr-top?
private static final String TOP_CSS_CLASS_PREFIX = "rf-pm-top-gr";
@Override
@@ -64,12 +66,14 @@
context.getExternalContext().getRequestParameterMap();
// Don't overwrite the value unless you have to!
+ //TODO nick - ":expanded" suffix is not necessary
String newValue = requestMap.get(component.getClientId() +
":expanded");
if (newValue != null) {
menuGroup.setSubmittedExpanded(newValue);
}
String compClientId = component.getClientId(context);
+ //TODO nick - rename clientId to smth.
String clientId = requestMap.get(compClientId);
if (clientId != null && clientId.equals(compClientId)) {
context.getPartialViewContext().getRenderIds().add(clientId);
@@ -79,6 +83,7 @@
}
}
+ //TODO nick - copy of
org.richfaces.renderkit.html.PanelMenuRenderer.addOnCompleteParam(String)
protected static void addOnCompleteParam(String itemId) {
AjaxContext.getCurrentInstance().appendOncomplete(new StringBuilder()
.append("RichFaces.$('").append(itemId).append("').onCompleteHandler();").toString());
@@ -94,6 +99,7 @@
writer.startElement(HtmlConstants.INPUT_ELEM, component);
+ //TODO nick - there is no need to encode this input - group state can be
extracted from class
final String expanded = component.getClientId(context) + ":expanded";
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, expanded, null);
writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, expanded, null);
@@ -106,6 +112,7 @@
}
private void encodeHeader(ResponseWriter writer, FacesContext context,
HtmlPanelMenuGroup menuGroup) throws IOException {
+ //TODO nick - HtmlConstants.* should be used
writer.startElement("div", null);
writer.writeAttribute("id", menuGroup.getClientId(context) +
":hdr", null);
writer.writeAttribute("class", getCssClass(menuGroup,
"-hdr"), null);
@@ -116,12 +123,15 @@
private void encodeHeaderGroup(ResponseWriter writer, FacesContext context,
HtmlPanelMenuGroup menuItem, String classPrefix) throws IOException {
writer.startElement("table", null);
writer.writeAttribute("class", classPrefix + "-gr", null);
+ //TODO nick - TBODY is missing
writer.startElement("tr", null);
encodeHeaderGroupIconLeft(writer, context, menuItem, classPrefix);
writer.startElement("td", null);
writer.writeAttribute("class", classPrefix + "-lbl", null);
+ //TODO nick - this will render 'null' if label is null
+ //TODO nick - should there be 'label' facet also?
writer.writeText(String.valueOf(menuItem.getLabel()), null);
writer.endElement("td");
@@ -142,6 +152,7 @@
String iconCollapsed = menuItem.isDisabled() ? menuItem.getIconRightDisabled() :
menuItem.getIconRightCollapsed();
String iconExpanded = menuItem.isDisabled() ? menuItem.getIconRightDisabled() :
menuItem.getIconRightExpanded();
+ //TODO nick - should this be "-ico-exp"? also why expanded icon state
is connected with right icon alignment?
encodeTdIcon(writer, context, classPrefix + "-exp-ico",
menuItem.isExpanded(), iconCollapsed, iconExpanded);
}
@@ -149,11 +160,13 @@
writer.startElement("td", null);
writer.writeAttribute("class", cssClass, null);
try {
+ //TODO nick - attrIconCollapsedValue == null?
AbstractPanelMenuItem.Icons iconCollapsed =
AbstractPanelMenuItem.Icons.valueOf(attrIconCollapsedValue);
writer.startElement("div", null);
writer.writeAttribute("class",
concatClasses("rf-pm-ico-colps", iconCollapsed.cssClass()), null);
writer.writeAttribute("style", styleElement("display",
isExpanded ? "none" : "block"), null);
writer.endElement("div");
+ //TODO nick - I suggest to wrap only Enum.valueOf(...) into try/catch
} catch (IllegalArgumentException e) {
if(attrIconCollapsedValue != null &&
attrIconCollapsedValue.trim().length() != 0) {
writer.startElement(HtmlConstants.IMG_ELEMENT, null);
@@ -219,6 +232,7 @@
HtmlPanelMenuGroup panelMenuGroup = (HtmlPanelMenuGroup) component;
Map<String, Object> options = new HashMap<String, Object>();
+ //TODO nick - non-default values should not be rendered
options.put("ajax", getAjaxOptions(context, panelMenuGroup));
options.put("name", panelMenuGroup.getName());
options.put("mode", panelMenuGroup.getMode());
@@ -244,6 +258,7 @@
encodeContentEnd(writer, context, component);
writer.endElement(HtmlConstants.DIV_ELEM);
+ //TODO nick - call super.doEncodeEnd(...)?
}
@Override
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -23,22 +23,23 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractPanelMenuItem;
import org.richfaces.component.html.HtmlPanelMenuItem;
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
/**
* @author akolonitsky
* @since 2010-10-25
@@ -63,6 +64,7 @@
private void encodeHeaderGroupBegin(ResponseWriter writer, FacesContext context,
HtmlPanelMenuItem menuItem, String classPrefix) throws IOException {
writer.startElement("table", null);
writer.writeAttribute("class", classPrefix + "-gr", null);
+ //TODO nick - TBODY element is missing
writer.startElement("tr", null);
encodeHeaderGroupLeftIcon(writer, context, menuItem, classPrefix);
@@ -99,6 +101,7 @@
encodeTdIcon(writer, context, cssClasses, icon);
}
+ //TODO nick - the same as in PanelMenuGroupRenderer
public void encodeTdIcon(ResponseWriter writer, FacesContext context, String
classPrefix, String attrIconValue) throws IOException {
writer.startElement("td", null);
try {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-12-13
19:09:26 UTC (rev 20542)
@@ -23,31 +23,33 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.JSObject;
-import org.richfaces.component.AbstractPanelMenu;
-import org.richfaces.component.AbstractPanelMenuItem;
-import org.richfaces.component.html.HtmlPanelMenu;
-import org.richfaces.renderkit.HtmlConstants;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractPanelMenu;
+import org.richfaces.component.AbstractPanelMenuItem;
+import org.richfaces.component.html.HtmlPanelMenu;
+import org.richfaces.renderkit.HtmlConstants;
/**
* @author akolonitsky
* @since 2010-10-25
*/
@ResourceDependencies( { // TODO review
+ //TODO nick - use org.richfaces:ajax.reslib
@ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "richfaces.js"),
@@ -67,11 +69,13 @@
context.getExternalContext().getRequestParameterMap();
// Don't overwrite the value unless you have to!
+ //TODO nick - getValueRequestParamName(...) is method of TogglePanelRenderer -
how are these components connected?
String newValue = requestMap.get(getValueRequestParamName(context, component));
if (newValue != null) {
panelMenu.setSubmittedActiveItem(newValue);
}
+ //TODO nick - I suggest to get this code moved to item renderer
String compClientId = component.getClientId(context);
String clientId = requestMap.get(compClientId);
if (clientId != null && clientId.equals(compClientId)) {
@@ -79,6 +83,8 @@
AbstractPanelMenuItem panelItem = panelMenu.getItem(newValue);
if (panelItem != null) {
new ActionEvent(panelItem).queue();
+
+ //TODO nick - why render item by default?
context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
//TODO nick - this should be done on encode, not on decode
@@ -124,6 +130,7 @@
HtmlPanelMenu panelMenu = (HtmlPanelMenu) component;
Map<String, Object> options = new HashMap<String, Object>();
+ //TODO nick - only options with non-default values should be rendered
options.put("ajax", getAjaxOptions(context, panelMenu));
options.put("disabled", panelMenu.isDisabled());
options.put("expandSingle", panelMenu.isExpandSingle());
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2010-12-13
19:09:26 UTC (rev 20542)
@@ -195,6 +195,7 @@
__addUserEventHandler : function (name) {
var handler = this.options["on" + name];
if (handler) {
+ //TODO nick - this will cause slowdowns in IE
rf.Event.bindById(this.id, name, handler);
}
},
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2010-12-13
18:46:54 UTC (rev 20541)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2010-12-13
19:09:26 UTC (rev 20542)
@@ -127,6 +127,7 @@
var menuGroup = this;
if (!this.options.selectable) {
+ //TODO nick - this can be replaced by jQuery.delegate on menu itself
this.__header().bind("click", function () {
return menuGroup.switchExpantion();
});
@@ -170,6 +171,7 @@
}
});
+ //TODO nick - why?
event.stopPropagation();
});
}
@@ -211,6 +213,7 @@
this.__collapse();
this.__childGroups().each (function(index, group) {
+ //TODO nick - why not group.collapse()?
rf.$(group.id).__collapse();
});
@@ -342,12 +345,14 @@
},
__fireCollapse : function () {
+ //TODO nick - 'new' should be removed
return new rf.Event.fireById(this.id, "collapse", {
id: this.id
});
},
__fireExpand : function () {
+ //TODO nick - 'new' should be removed
return new rf.Event.fireById(this.id, "expand", {
id: this.id
});