Unspecified error on s:button
bossy Feb 11, 2010 1:39 PMHello,
I came across some rather strange behaviour of tag s:button.
I have an onbeforeunload event on my page that asks the user whether to continue or not with certain actions. The problem I have is this: if the user clicks on a s:button element and selects to stay on the current page an “Unspecified error” appears, although it does not seem to be having any effect on the result. The same action with s:link works fine.
Below is a test page that demonstrates this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <f:view contentType="text/html" xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:s="http://jboss.com/products/seam/taglib"> <html > <head> <script type="text/javascript" event="onbeforeunload" for="window"> event.returnValue= 'You have unsaved changes' ; </script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Test</title> <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/> <a:loadStyle src="/stylesheet/theme.css"/> <ui:insert name="head"/> </head> <body onunload=""> <div class="body" > <s:button id="homeB" value="Home" propagation="end" view="/home.xhtml" rendered="true"/> <s:link id="homeL" value="Home" propagation="end" view="/home.xhtml" rendered="true"/> </div> </body> </html> </f:view>
I'm using seam 2.1.1.GA and the application runs in IE6.
Does anybody have an idea what might be causing this? Or is it a bug?
Thanks.