Author: maksimkaszynski
Date: 2008-03-21 13:10:59 -0400 (Fri, 21 Mar 2008)
New Revision: 7074
Modified:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
Log:
supportd rowKeyConverter
Modified:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2008-03-21
17:04:14 UTC (rev 7073)
+++
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2008-03-21
17:10:59 UTC (rev 7074)
@@ -11,13 +11,13 @@
import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
import javax.faces.event.MethodExpressionActionListener;
import javax.faces.event.MethodExpressionValueChangeListener;
import javax.faces.validator.MethodExpressionValidator;
import javax.faces.webapp.UIComponentELTag;
import org.ajax4jsf.Messages;
+import org.ajax4jsf.component.UIDataAdaptor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -67,6 +67,23 @@
}
}
+ protected void setRowKeyConverterProperty(UIComponent component, ValueExpression
converter) {
+ if (converter != null) {
+ if (component instanceof UIDataAdaptor) {
+ UIDataAdaptor data = (UIDataAdaptor) component;
+ if (!converter.isLiteralText()) {
+ component.setValueExpression("rowKeyConverter", converter);
+ } else {
+ Converter conv =
FacesContext.getCurrentInstance().getApplication().createConverter(converter.getExpressionString());
+ data.setRowKeyConverter(conv);
+ }
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
component.getClass().getName()));
+ }
+ }
+ }
+
+
protected void setValidatorProperty(UIComponent component, MethodExpression validator)
{
if (validator != null) {
Modified: trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2008-03-21
17:04:14 UTC (rev 7073)
+++ trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2008-03-21
17:10:59 UTC (rev 7074)
@@ -186,6 +186,7 @@
ACESSING_SKIN_PROPERTY_ERROR=Attempt to access to skin property not as string parameter
SKIN_PROPERTIES_READ_ONLY_ERROR=Skin properties is read-only
NO_VALUE_HOLDER_ERROR=Component {0} is no ValueHolder, cannot set value.
+NO_DATA_ADAPTOR=Component {0} is no UIDataAdaptor.
NO_EDITABLE_VALUE_HOLDER_ERROR=Component {0} is no EditableValueHolder
INVALID_VALIDATION_EXPRESSION=Component {0} has invalid validation expression {1}
NO_ACTION_SOURCE_ERROR=Component {0} is no ActionSource
Show replies by date