You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by id...@apache.org on 2010/09/02 15:49:01 UTC
svn commit: r991935 - in /myfaces/tobago/trunk/tobago-theme:
tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sta...
Author: idus
Date: Thu Sep 2 13:49:01 2010
New Revision: 991935
URL: http://svn.apache.org/viewvc?rev=991935&view=rev
Log:
TOBAGO-910: tc:upload hangs when entering invalid filename in IE 6
- prohibit entering text in file input via JS
- handle exception during client-side submit by removing transitioning pane and display an alert
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java?rev=991935&r1=991934&r2=991935&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java Thu Sep 2 13:49:01 2010
@@ -25,6 +25,7 @@ package org.apache.myfaces.tobago.render
import org.apache.commons.fileupload.FileItem;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UIFileInput;
+import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.internal.webapp.TobagoMultipartFormdataRequest;
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
@@ -127,6 +128,10 @@ public class FileRenderer extends InputR
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
HtmlRendererUtils.renderTip(input, writer);
+ if (ClientProperties.getInstance(facesContext).getUserAgent().isMsie6()) {
+ writer.writeAttribute(HtmlAttributes.ONKEYDOWN, "this.blur();return false;", false);
+ writer.writeAttribute("oncontextmenu", "return false;", false);
+ }
writer.endElement(HtmlElements.INPUT);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=991935&r1=991934&r2=991935&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Thu Sep 2 13:49:01 2010
@@ -527,8 +527,14 @@ var Tobago = {
// new
var onSubmitResult = Tobago.onSubmit();
if (onSubmitResult) {
- // LOG.debug("submit form with action: " + Tobago.action.value);
- Tobago.form.submit();
+ try {
+ // LOG.debug("submit form with action: " + Tobago.action.value);
+ Tobago.form.submit();
+ } catch(e) {
+ Tobago.deleteOverlay(Tobago.page);
+ Tobago.isSubmit = false;
+ alert("Submit failed: " + e); // XXX localization, better error handling
+ }
}
Tobago.action.value = oldAction;
if (target) {