Author: Alex.Kolonitsky
Date: 2011-01-31 09:47:54 -0500 (Mon, 31 Jan 2011)
New Revision: 21326
Modified:
trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml
Log:
RF-10326: Panel Menu Group - add @expanded reflecting state of component
RF-10238 Tooltip: element id contains '@'
Modified: trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-01-31
14:45:02 UTC (rev 21325)
+++ trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-01-31
14:47:54 UTC (rev 21326)
@@ -56,7 +56,7 @@
</rich:panelMenuGroup>
<rich:panelMenuItem id="item2" label="Item 2"
disabled="true" />
<rich:panelMenuItem id="item3" label="Item 3" />
- <rich:panelMenuGroup id="group4" label="Group 4">
+ <rich:panelMenuGroup id="group4" label="Group 4"
expanded="false">
<rich:panelMenuItem id="item41" label="Item 4.1" />
<rich:panelMenuItem id="item42" label="Item 4.2"
disabled="true" />
<rich:panelMenuGroup id="group43" label="Group 4.1"
disabled="true">
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 2011-01-31
14:45:02 UTC (rev 21325)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-01-31
14:47:54 UTC (rev 21326)
@@ -125,6 +125,7 @@
this.submittedExpanded = Boolean.parseBoolean(String.valueOf(submittedValue));
}
+ @Attribute
public boolean isExpanded() {
return getValue() == null ? false : (Boolean) getValue();
}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-31
14:45:02 UTC (rev 21325)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-31
14:47:54 UTC (rev 21326)
@@ -23,23 +23,6 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
-import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
-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.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.PartialResponseWriter;
-import javax.faces.context.ResponseWriter;
-
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.TooltipMode;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -49,6 +32,22 @@
import org.richfaces.renderkit.MetaComponentRenderer;
import org.richfaces.renderkit.util.RendererUtils;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialResponseWriter;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
/**
* @author amarkhel
* @since 2010-10-24
@@ -123,7 +122,7 @@
private void encodeContentBegin(ResponseWriter writer, FacesContext context,
AbstractTooltip tooltip) throws IOException {
writer.startElement(getMarkupElement(tooltip), tooltip);
- writer.writeAttribute(ID_ATTRIBUTE, tooltip.getClientId(context) +
"@content", null);
+ writer.writeAttribute(ID_ATTRIBUTE, tooltip.getClientId(context) +
":content", null);
writer.writeAttribute(CLASS_ATTRIBUTE, "rf-tt-cnt", null);
}
@@ -213,7 +212,7 @@
if (AbstractTooltip.CONTENT_META_COMPONENT_ID.equals(metaComponentId)) {
AbstractTooltip tooltip = (AbstractTooltip) component;
PartialResponseWriter writer =
context.getPartialViewContext().getPartialResponseWriter();
- writer.startUpdate(((AbstractTooltip)
component).getContentClientId(context));
+ writer.startUpdate(tooltip.getClientId(context) + ":" +
AbstractTooltip.CONTENT_META_COMPONENT_ID);
encodeContentBegin(writer, context, tooltip);
for (UIComponent child : tooltip.getChildren()) {
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js 2011-01-31
14:45:02 UTC (rev 21325)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js 2011-01-31
14:47:54 UTC (rev 21326)
@@ -244,7 +244,7 @@
},
__content : function () {
- return $(document.getElementById(this.id + "@content"));
+ return $(document.getElementById(this.id + ":content"));
},
__fireHide : function () {
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml 2011-01-31
14:45:02 UTC (rev 21325)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/tooltip.xmlunit.xml 2011-01-31
14:47:54 UTC (rev 21326)
@@ -1,6 +1,6 @@
<span id="f:tooltip" class="rf-tt">
<span id="f:tooltip:cntr" class="rf-tt-cntr">
- <span id="f:tooltip@content"
class="rf-tt-cnt"></span>
+ <span id="f:tooltip:content"
class="rf-tt-cnt"></span>
</span>
<script type="text/javascript">
// Text
Show replies by date