Author: sergeyhalipov
Date: 2008-02-22 07:41:04 -0500 (Fri, 22 Feb 2008)
New Revision: 6283
Modified:
trunk/samples/dataTableDemo/pom.xml
trunk/ui/dataTable/pom.xml
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
Added inplace inputs to headers with filter.
Modified: trunk/samples/dataTableDemo/pom.xml
===================================================================
--- trunk/samples/dataTableDemo/pom.xml 2008-02-22 11:30:39 UTC (rev 6282)
+++ trunk/samples/dataTableDemo/pom.xml 2008-02-22 12:41:04 UTC (rev 6283)
@@ -25,5 +25,10 @@
<artifactId>skins</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>inplaceInput</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/ui/dataTable/pom.xml
===================================================================
--- trunk/ui/dataTable/pom.xml 2008-02-22 11:30:39 UTC (rev 6282)
+++ trunk/ui/dataTable/pom.xml 2008-02-22 12:41:04 UTC (rev 6283)
@@ -48,10 +48,5 @@
<version>3.2.0-SNAPSHOT</version>
</dependency>
-->
- <dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
- <artifactId>inplaceInput</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </dependency>
</dependencies>
</project>
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22
11:30:39 UTC (rev 6282)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22
12:41:04 UTC (rev 6283)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
@@ -37,13 +38,11 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.resource.InternetResource;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.FilterIterator;
import org.richfaces.component.Column;
import org.richfaces.component.Row;
import org.richfaces.component.UIDataTable;
-import org.richfaces.component.UIInplaceInput;
import org.richfaces.model.Ordering;
/**
@@ -526,7 +525,10 @@
}
}
String filterValue = map.get(children.getClientId(context) + SORT_FILTER_PARAMETER
+
- UIInplaceInput.VALUE_SUFFIX);
+ "value");
+ if (filterValue == null) {
+ filterValue = map.get(children.getClientId(context) + SORT_FILTER_PARAMETER);
+ }
if (filterValue != null) {
column.setFilterValue(filterValue);
}
@@ -541,17 +543,20 @@
protected void encodeInplaceInput(FacesContext context, UIComponent column, StringBuffer
buffer)
throws IOException {
UIInput filterValueInput = (UIInput)column.getFacet(FILTER_INPUT_FACET_NAME);
+ String event = "onviewactivated";
if (null == filterValueInput) {
- filterValueInput = (UIInput)
context.getApplication().createComponent(UIInplaceInput.COMPONENT_TYPE);
- if (null == filterValueInput) {
+ try {
+ filterValueInput = (UIInput)
context.getApplication().createComponent("org.richfaces.InplaceInput");
+ } catch (FacesException e) {
filterValueInput = (UIInput)
context.getApplication().createComponent(UIInput.COMPONENT_TYPE);
+ event = "onchange";
}
filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
filterValueInput.setImmediate(true);
filterValueInput.getAttributes().put("onclick",
"Event.stop(event);");
column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
}
- filterValueInput.getAttributes().put("onviewactivated", buffer.toString());
+ filterValueInput.getAttributes().put(event, buffer.toString());
filterValueInput.setValue(column.getAttributes().get("filterValue"));
getUtils().encodeBeginFormIfNessesary(context, column);