Author: nbelaevski
Date: 2008-09-05 14:21:55 -0400 (Fri, 05 Sep 2008)
New Revision: 10331
Modified:
branches/3.2.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-4413
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-05
16:27:48 UTC (rev 10330)
+++
branches/3.2.x/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-09-05
18:21:55 UTC (rev 10331)
@@ -114,25 +114,14 @@
private void ensureParentPresent(UIComponent component) {
UIComponent parent = component.getParent();
UIContextMenu menu = (UIContextMenu) component;
- String attachTo = menu.getAttachTo();
- boolean isAttached = false;
- if(null != attachTo && !attachTo.equals("")){
- isAttached = true;
- }
if (parent != null) {
- if (HtmlUtil.shouldWriteId(parent)) {
- return;
- } else
- {
- if(!isAttached){
-
+ if (!HtmlUtil.shouldWriteId(parent) && menu.isAttached()) {
throw new FacesException(
"Context menu cannot be attached to the component with id = "
- + parent.getId()
- + ", because a client identifier of the component won't be rendered onto
the page. Please, set the identifier.");
+ + parent.getId()
+ + ", because a client identifier of the component won't be rendered onto
the page. Please, set the identifier.");
}
- }
} else {
throw new FacesException(
"Parent component is null for ContextMenu "