Skip navigation links


org.apache.myfaces.trinidad.util
Class ListFromCollection

java.lang.Object
  extended by org.apache.myfaces.trinidad.util.ListFromCollection


public class ListFromCollection
extends java.lang.Object

Bean that can dynamically produce Lists from Collections. The Collections must implement size(). Create an instance of this bean as a managed bean:

Example:

  <managed-bean>
    <managed-bean-name>makeList</managed-bean-name>
    <managed-bean-class>
       org.apache.myfaces.trinidad.util.ListFromCollection
    </managed-bean-class>
    <managed-bean-scope>
       request
    </managed-bean-scope>
    <!-- Let's buffer 25 rows at a time (the default is 50) -->
    <managed-property>
      <property-name>size</property-name>
      <value>25</value>
    <managed-property>
  </managed-bean>
 
   <h:dataTable value="#{makeList.list[someSet]}>
   </h:dataTable>
 

Note, though, that it is extremely expensive to use this bean for the items of an tr:forEach (or c:forEach in JSF 1.2 or Facelets).


Constructor Summary
ListFromCollection()
           

 

Method Summary
 java.util.Map<java.util.Collection<?>,java.util.List<?>> getList()
           
 int getSize()
           
 void setSize(int size)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ListFromCollection

public ListFromCollection()

Method Detail

getList

public java.util.Map<java.util.Collection<?>,java.util.List<?>> getList()

getSize

public int getSize()

setSize

public void setSize(int size)

Skip navigation links


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.