Author: musachy Date: Wed Jan 28 21:12:12 2009 New Revision: 738624 URL: http://svn.apache.org/viewvc?rev=738624&view=rev Log: WW-2966 ToolTips do not render correctly
Added: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-4.txt Modified: struts/struts2/trunk/core/src/main/resources/template/xhtml/tooltip.ftl struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java Modified: struts/struts2/trunk/core/src/main/resources/template/xhtml/tooltip.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/xhtml/tooltip.ftl?rev=738624&r1=738623&r2=738624&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/resources/template/xhtml/tooltip.ftl (original) +++ struts/struts2/trunk/core/src/main/resources/template/xhtml/tooltip.ftl Wed Jan 28 21:12:12 2009 @@ -35,7 +35,7 @@ <#t/>,'styleClass', '${parameters.tooltipCssClass?default("StrutsTTClassic")}'<#t/> <#t/>)" /> <#else> - title="${parameters.tooltip?html}"/> - alt="${parameters.tooltip?html}" + title="${parameters.tooltip?html}" + alt="${parameters.tooltip?html}" /> </#if> </#if><#t/> Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java?rev=738624&r1=738623&r2=738624&view=diff ============================================================================== --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java Wed Jan 28 21:12:12 2009 @@ -68,6 +68,40 @@ verify(TooltipTest.class.getResource("tooltip-1.txt")); } + + public void testWithoutFormOverridingNoJS() throws Exception { + + // we test it on textfield component, but since the tooltip are common to + // all components, it will be the same for other components as well. + FormTag formTag = new FormTag(); + formTag.setPageContext(pageContext); + formTag.setId("myFormId"); + formTag.setAction("testAction"); + formTag.setName("myForm"); + + + TextFieldTag tag = new TextFieldTag(); + tag.setPageContext(pageContext); + tag.setLabel("MyLabel"); + tag.setId("myId"); + + + tag.setTooltip("myTooltip"); + tag.setTooltipConfig( + "#{" + + "'tooltipIcon':'/struts/tooltip/myTooltip.gif', " + + "'tooltipDelay':'500', " + + "'jsTooltipEnabled':'false' "+ + "}" + ); + + formTag.doStartTag(); + tag.doStartTag(); + tag.doEndTag(); + formTag.doEndTag(); + + verify(TooltipTest.class.getResource("tooltip-4.txt")); + } public void testWithoutFormOverridingNew() throws Exception { Added: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-4.txt URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-4.txt?rev=738624&view=auto ============================================================================== --- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-4.txt (added) +++ struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-4.txt Wed Jan 28 21:12:12 2009 @@ -0,0 +1,19 @@ +<form id="myFormId" name="myForm" action="/testAction.action" method="post"> + <tableclass="wwFormTable"> + <tr> + <td class="tdLabel"> + <labelfor="myId"class="label"> + MyLabel:<img + src='/struts/tooltip/myTooltip.gif' + title="myTooltip" alt="myTooltip" /> + </label> + </td> + <td> + <input type="text" name="" id="myId"/> + </td> + </tr> + </table> +</form> + + +