Author: nbelaevski
Date: 2008-09-08 10:45:58 -0400 (Mon, 08 Sep 2008)
New Revision: 10351
Modified:
branches/3.2.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-4421
Modified:
branches/3.2.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
===================================================================
---
branches/3.2.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-09-08
13:52:35 UTC (rev 10350)
+++
branches/3.2.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-09-08
14:45:58 UTC (rev 10351)
@@ -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()