Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.1.8-SNAPSHOT
-
None
-
None
-
tomcat 6.0.16
java 1.6.0
tomahawk 1.1.8-SNAPSHOT
Description
Here's what my page rendered for my swapImage:
<img id="_idJsp0:foo" src="/MYFACES11-Playground/images/MyFaces_logo.jpg" onmouseover="SI_MM_swapImage('_idJsp0:foo','','/MYFACES11-Playground/images/feather.gif',1);" onmouseout="SI_MM_swapImgRestore();" border="Integer.MIN_VALUE" onmouseover="alert('onmouseover2');" onmouseout="alert('onmouseout2');" />
As you can see, onmouseover and onmouseout are rendered twice. In this case, alert('onmouseover2') and alert('onmouseout2') never get executed.
Both onmouseover and onmouseout attributes are not declared as attributes of swapImage tag in tomahawk.tld. You can only replicate this bug if you bind your swapImage object to a bean. Here's my bean:
public class SwapImageBean
{
private HtmlSwapImage swapImage;
public SwapImageBean()
{ swapImage = new HtmlSwapImage(); swapImage.getAttributes().put(HTML.ONMOUSEOVER_ATTR, "alert('onmouseover2');"); swapImage.getAttributes().put(HTML.ONMOUSEOUT_ATTR, "alert('onmouseout2');"); }public HtmlSwapImage getSwapImage()
{ return swapImage; }public void setSwapImage(HtmlSwapImage swapImage)
{ this.swapImage = swapImage; }}