Author: pgolawski
Date: 2009-01-26 09:16:53 -0500 (Mon, 26 Jan 2009)
New Revision: 12422
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
Log:
bugfix for IE: set focus to filter input on filter event
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
---
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2009-01-26
13:24:23 UTC (rev 12421)
+++
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2009-01-26
14:16:53 UTC (rev 12422)
@@ -332,10 +332,15 @@
}
private JSFunctionDefinition buildSetFocusFunctionDef(String elementId){
- JSFunctionDefinition function = new JSFunctionDefinition("event");
- function.addToBody("" + "var element =
document.getElementById('"
- + elementId + "');" + "if (element) {" +
" element.focus();"
- + "}");
+ JSFunctionDefinition function = new
JSFunctionDefinition("request","event","data");
+ function.addToBody(
+ "var element = request.form.elements['" + elementId +
"'];" +
+ "if (!element) {element = document.getElementById('" + elementId +
"')}" +
+ "if (element) {" +
+ "element.focus();" +
+ //"if (element.createTextRange) { var r = (element.createTextRange());
r.collapse(false); r.select();}" +
+ "element.value = element.value;" +
+ "}");
return function;
}
Show replies by date