Author: sergeyhalipov
Date: 2008-02-22 06:30:39 -0500 (Fri, 22 Feb 2008)
New Revision: 6282
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
Log:
Added inplace inputs to headers with filter.
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-02-22
11:03:02 UTC (rev 6281)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-02-22
11:30:39 UTC (rev 6282)
@@ -731,7 +731,7 @@
writer.writeAttribute(HTML.id_ATTRIBUTE, clientId, null);
writer.writeAttribute(HTML.NAME_ATTRIBUTE, clientId, null);
writer.writeAttribute(HTML.METHOD_ATTRIBUTE, "post", null);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "margin:0; padding:0;",
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "margin:0; padding:0; display:
inline;",
null);
writer.writeURIAttribute(HTML.ACTION_ATTRIBUTE, encodeActionURL,
"action");
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:03:02 UTC (rev 6281)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22
11:30:39 UTC (rev 6282)
@@ -29,6 +29,7 @@
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -53,7 +54,7 @@
private static final String SORT_FILTER_PARAMETER = "fsp";
- private UIInplaceInput filterValueInput = null;
+ private static final String FILTER_INPUT_FACET_NAME = "filterValueInput";
/**
* Encode all table structure - colgroups definitions, caption, header,
@@ -539,13 +540,22 @@
protected void encodeInplaceInput(FacesContext context, UIComponent column, StringBuffer
buffer)
throws IOException {
+ UIInput filterValueInput = (UIInput)column.getFacet(FILTER_INPUT_FACET_NAME);
if (null == filterValueInput) {
- filterValueInput = (UIInplaceInput)
context.getApplication().createComponent(UIInplaceInput.COMPONENT_TYPE);
+ filterValueInput = (UIInput)
context.getApplication().createComponent(UIInplaceInput.COMPONENT_TYPE);
+ if (null == filterValueInput) {
+ filterValueInput = (UIInput)
context.getApplication().createComponent(UIInput.COMPONENT_TYPE);
+ }
filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
- column.getParent().getChildren().add(filterValueInput);
+ 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.setValue(column.getAttributes().get("filterValue"));
+
+ getUtils().encodeBeginFormIfNessesary(context, column);
renderChild(context, filterValueInput);
+ getUtils().encodeEndFormIfNessesary(context, column);
}
}
\ No newline at end of file
Modified:
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
===================================================================
---
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2008-02-22
11:03:02 UTC (rev 6281)
+++
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2008-02-22
11:30:39 UTC (rev 6282)
@@ -95,6 +95,7 @@
<u:style name="font-size" skin="generalSizeFont"/>
<!--generalSizeFont-->
<u:style name="color" skin="generalTextColor"/>
<!--generalTextColor-->
<u:style name="font-family" skin="generalFamilyFont"/>
<!--generalFamilyFont-->
+ <u:style name="white-space" value="nowrap"/>
</u:selector>
<f:verbatim>
Show replies by date