Author: jjamrich
Date: 2012-01-16 09:12:15 -0500 (Mon, 16 Jan 2012)
New Revision: 23150
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/rf11783.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml
Log:
RF-11873: add example demonstrating problem with tooltip
A4j:commnadButton with tooltip, rerendered conditionaly causes whole button disappear when
condition to rerender is met.
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2012-01-16
14:11:55 UTC (rev 23149)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2012-01-16
14:12:15 UTC (rev 23150)
@@ -49,6 +49,8 @@
private Attributes attributes;
private int counter = 0;
+
+ private String testProperty;
/**
* Initializes the managed bean.
@@ -78,6 +80,10 @@
// intentionally hidden attributes
attributes.remove("localValue");
}
+
+ public void changePropertyVal() {
+ this.testProperty = "blablabl";
+ }
public Attributes getAttributes() {
return attributes;
@@ -94,4 +100,12 @@
public Date getTooltipDate() {
return new Date();
}
+
+ public String getTestProperty() {
+ return testProperty;
+ }
+
+ public void setTestProperty(String testProperty) {
+ this.testProperty = testProperty;
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml 2012-01-16
14:11:55 UTC (rev 23149)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/list.xhtml 2012-01-16
14:12:15 UTC (rev 23150)
@@ -46,6 +46,10 @@
<metamer:testPageLink id="rf10960" outcome="rf10960"
value="RF-10960">
Page demonstrating problems with tooltip in IE7.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="rf11783" outcome="rf11783"
value="RF-11783">
+ Page demonstrating problems with tooltip within button.
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/rf11783.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/rf11783.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/rf11783.xhtml 2012-01-16
14:12:15 UTC (rev 23150)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <p>The button is initially disabled, then richTooltipBean.testProperty
is set true and we do ajax render="myButton".
+ The button should disappears from the screen. Removing the tooltip should
makes it work as expected.
+ <br/>
+ In my example button doesn't disappear, but button's value changes to
"Undefined" which should be indicating problem.
+
+ </p>
+
+ <a4j:commandButton id="triggerUpdate" value="Update
testValue and rerender next Button"
+
actionListener="#{richTooltipBean.changePropertyVal}"
render="myButton" />
+ <br/>
+ <a4j:commandButton id="triggerUpdateEDT" value="Update
testValue and rerender Button in EDT"
+
actionListener="#{richTooltipBean.changePropertyVal}"
render="myEDTButton" />
+ <br/>
+ <br/>
+
+ <!-- component -->
+ <a4j:commandButton id="myButton"
+ value=" test "
+ action="apage?faces-redirect=true"
+ disabled="#{empty
richTooltipBean.testProperty}">
+ <rich:tooltip mode="client" showDelay="850">
+ <h:panelGroup layout="block" style="width: 200px;
text-align: justify">
+ <h:outputText escape="false" value="some
text"/>
+ </h:panelGroup>
+ </rich:tooltip>
+ </a4j:commandButton>
+
+ <br/>
+ <br/>
+
+ <rich:extendedDataTable id="richEDT"
+ rows="3"
+ value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
+ var="record"
+ style="width: 230px;"
+ >
+
+ <rich:column id="columnState"
sortBy="#{record.state}">
+ <h:outputText value="#{record.state}" />
+ </rich:column>
+
+ <rich:column id="columnCapital"
sortBy="#{record.name}">
+ <h:outputText value="#{record.name}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <a4j:commandButton id="myEDTButton"
+ value=" test EDT "
+ action="apage?faces-redirect=true"
+ disabled="#{empty
richTooltipBean.testProperty}">
+ <rich:tooltip mode="client"
showDelay="850">
+ <h:panelGroup layout="block" style="width:
200px; text-align: justify">
+ <h:outputText escape="false" value="some
text"/>
+ </h:panelGroup>
+ </rich:tooltip>
+ </a4j:commandButton>
+ </f:facet>
+
+ </rich:extendedDataTable>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file