Author: sergeyhalipov
Date: 2008-03-06 15:30:53 -0500 (Thu, 06 Mar 2008)
New Revision: 6610
Modified:
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-2422
Modified: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-03-06 18:28:05
UTC (rev 6609)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-03-06 20:30:53
UTC (rev 6610)
@@ -104,4 +104,10 @@
<classname>java.lang.String</classname>
<description>Event for filter input that forces the filtration (default =
onchange)</description>
<defaultvalue>"onchange"</defaultvalue>
-</property>
+</property>
+<property>
+ <name>filterDefaultLabel</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+</property>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java 2008-03-06
18:28:05 UTC (rev 6609)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java 2008-03-06
20:30:53 UTC (rev 6610)
@@ -49,9 +49,11 @@
private String filterValue;
public abstract String getSortMode();
-
public abstract void setSortMode(String mode);
+ public abstract String getFilterDefaultLabel();
+ public abstract void setFilterDefaultLabel(String label);
+
public FilterField getFilterField(){
FilterField filterField = null;
MethodExpression filterMethod = getFilterMethod();
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-06
18:28:05 UTC (rev 6609)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-06
20:30:53 UTC (rev 6610)
@@ -510,14 +510,22 @@
column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
filterValueInput.getAttributes().put(HTML.onclick_ATTRIBUTE,
"Event.stop(event);");
}
- String onkeydownEvent = inplaceInput ? "oninputkeydown" :
HTML.onkeydown_ATTRIBUTE;
+ String onkeydownEvent = HTML.onkeydown_ATTRIBUTE;
String filterEvent = (String) column.getAttributes().get("filterEvent");
+ if (inplaceInput) {
+ onkeydownEvent = "oninputkeydown";
+ filterValueInput.getAttributes().put("defaultLabel",
column.getAttributes().get("filterDefaultLabel"));
+ }
if (null == filterEvent || "".equals(filterEvent)) {
filterEvent = "onchange";
}
+
filterValueInput.getAttributes().put(filterEvent, buffer);
- filterValueInput.getAttributes().put(onkeydownEvent,
"RichFaces.blurFilterInput(event);");
+ if (!onkeydownEvent.equals(filterEvent)) {
+ filterValueInput.getAttributes().put(onkeydownEvent,
"RichFaces.blurFilterInput(event);");
+ }
+
filterValueInput.setValue(column.getAttributes().get("filterValue"));
getUtils().encodeBeginFormIfNessesary(context, column);