Author: dbiatenia
Date: 2007-07-18 14:10:03 -0400 (Wed, 18 Jul 2007)
New Revision: 1683
Modified:
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
Log:
default facet bugfix
Modified:
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-18
18:09:15 UTC (rev 1682)
+++
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-18
18:10:03 UTC (rev 1683)
@@ -50,7 +50,11 @@
Map eventOptions = AjaxRendererUtils.buildEventOptions(context, component);
- String refreshTooltipInDOM = ";" + getJsVarName(context, component) +
".toolTip = $('" + component.getClientId(context) + "');";
+ //after element is subsituted in DOM tree, we have to re-create
+ //it's JS-reference, cause old one is already invalid
+ String refreshTooltipInDOM = ";" + getJsVarName(context, component) +
".toolTip = $('" + component.getClientId(context) + "');" +
+ ";" + getJsVarName(context, component) + ".toolTipContent =
$('" + component.getClientId(context) + "content');";
+
String showNewToolTip = ";" + getJsVarName(context, component) +
".displayDiv();";
//enable ajaxSingle mode, i.e. we do not need to submit all form controls to get
tooltip content
Modified:
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-18
18:09:15 UTC (rev 1682)
+++
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-18
18:10:03 UTC (rev 1683)
@@ -22,6 +22,9 @@
this.ajaxExecuteString = ajaxFunction;
this.toolTip = $(id);
+ this.toolTipContent = $(id + 'content');
+ this.toolTipDefaultContent = $(id + 'defaultContent');
+
this.toolTip.style.visibility='hidden';
this.toolTip.style.display='block';
@@ -110,6 +113,9 @@
this.setToolTipPosition(e);
if(this.mode == 'ajax'){
+ if(this.toolTipDefaultContent){
+ this.toolTipContent.innerHTML = this.toolTipDefaultContent.innerHTML;
+ }
var event = e;
eval(this.ajaxExecuteString);
}
Modified:
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-18
18:09:15 UTC (rev 1682)
+++
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-18
18:10:03 UTC (rev 1683)
@@ -24,17 +24,16 @@
<f:clientid var="clientId"/>
<div id="#{clientId}" style="position: absolute; display :
none;z-index:99" class="dr-rich-tool-tip rich-tool-tip">
- <span id="#{clientId}script" style="display:none">
- <f:call name="insertScript"/>
- </span>
-
<span id="#{clientId}defaultContent"
style="display:none">
<u:insertFacet name="defaultContent" />
</span>
-
<vcp:body>
<f:call name="encodeTooltipText"/>
</vcp:body>
+ <f:clientid var="clientId"/>
+ <span id="#{clientId}script" style="display:none">
+ <f:call name="insertScript"/>
+ </span>
</div>
<!-- f:call name="utils.encodeEndFormIfNessesary"/-->