Author: nbelaevski
Date: 2008-09-08 10:55:46 -0400 (Mon, 08 Sep 2008)
New Revision: 10352
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-4421
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
===================================================================
---
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-09-08
14:45:58 UTC (rev 10351)
+++
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-09-08
14:55:46 UTC (rev 10352)
@@ -111,12 +111,16 @@
writer.writeAttribute(HTML.id_ATTRIBUTE, component.getClientId(context),
"id");
}
+ private boolean isEmpty(String s) {
+ return s == null || s.trim().length() == 0;
+ }
+
private void ensureParentPresent(UIComponent component) {
UIComponent parent = component.getParent();
UIContextMenu menu = (UIContextMenu) component;
if (parent != null) {
- if (!HtmlUtil.shouldWriteId(parent) && menu.isAttached()) {
+ if (!HtmlUtil.shouldWriteId(parent) && menu.isAttached() &&
isEmpty(menu.getAttachTo())) {
throw new FacesException(
"Context menu cannot be attached to the component with id = "
+ parent.getId()