You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/08/19 22:22:01 UTC
svn commit: r987294 -
/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
Author: lu4242
Date: Thu Aug 19 20:22:01 2010
New Revision: 987294
URL: http://svn.apache.org/viewvc?rev=987294&view=rev
Log:
TOMAHAWK-1537 t:datatable updateModelFromPreservedDataModel does not take into account vb.getType could not return the right type
Modified:
myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java?rev=987294&r1=987293&r2=987294&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java Thu Aug 19 20:22:01 2010
@@ -51,6 +51,7 @@ import org.apache.myfaces.custom.sorthea
import org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer;
import org.apache.myfaces.renderkit.html.util.TableContext;
import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
+import org.apache.myfaces.shared_tomahawk.util.ClassUtils;
/**
* The MyFacesDataTable extends the standard JSF DataTable by two
@@ -493,12 +494,15 @@ public abstract class AbstractHtmlDataTa
if (vb != null && !vb.isReadOnly(context))
{
_SerializableDataModel dm = (_SerializableDataModel) getDataModel();
- Class type = vb.getType(context);
+ Class type = (getValueType() == null) ?
+ vb.getType(context) :
+ ClassUtils.simpleClassForName(getValueType());
+ Class dmType = dm.getClass();
if (DataModel.class.isAssignableFrom(type))
{
vb.setValue(context, dm);
}
- else if (List.class.isAssignableFrom(type))
+ else if (List.class.isAssignableFrom(type) || _SerializableListDataModel.class.isAssignableFrom(dmType))
{
vb.setValue(context, dm.getWrappedData());
}
@@ -1759,5 +1763,16 @@ public abstract class AbstractHtmlDataTa
*
* @JSFProperty
*/
- public abstract String getDataformatas();
+ public abstract String getDataformatas();
+
+ /**
+ * Indicate the expected type of the EL expression pointed
+ * by value property. It is useful when vb.getType() cannot
+ * found the type, like when a map value is resolved on
+ * the expression.
+ *
+ * @JSFProperty
+ */
+ public abstract String getValueType();
+
}