Author: nickarls
Date: 2008-11-18 05:26:57 -0500 (Tue, 18 Nov 2008)
New Revision: 9589
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java
Log:
Minor. Make Maps iterable
Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-11-18 10:11:20 UTC (rev 9588)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-11-18 10:26:57 UTC (rev 9589)
@@ -415,7 +415,10 @@
<para>
<literal>value</literal>
—An EL-expression to the backing data. The
- value is a string.
+ value is a string. The target of this expression is
+ examined for an Iterable. Note that if the target is a
Map,
+ the iteration is done over the Map.Entry entrySet(), so
you
+ should use a .key or .value to target in your references.
</para>
</listitem>
<listitem>
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java 2008-11-18 10:11:20 UTC (rev
9588)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java 2008-11-18 10:26:57 UTC (rev
9589)
@@ -5,6 +5,7 @@
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.faces.model.DataModel;
@@ -556,6 +557,9 @@
{
return ((Iterable) ((DataModel) value).getWrappedData()).iterator();
}
+ else if (value instanceof Map) {
+ return ((Map) value).entrySet().iterator();
+ }
else if (value instanceof Query)
{
return (((Query) value).getResultList()).iterator();