You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by de...@struts.apache.org on 2005/02/21 12:14:43 UTC

[Apache Struts Wiki] Updated: StrutsCatalogLazyList

   Date: 2005-02-21T03:14:43
   Editor: FrankDean
   Wiki: Apache Struts Wiki
   Page: StrutsCatalogLazyList
   URL: http://wiki.apache.org/struts/StrutsCatalogLazyList

   Updated to reflect Commons-Collections 2.1.1 behaviour

Change Log:

------------------------------------------------------------------------------
@@ -149,6 +149,36 @@
 
 }}}
 
+
+The syntax in Commons-Collections 2.1.1 is;
+
+{{{
+
+  import org.apache.commons.collections.Factory;
+  import org.apache.commons.collections.ListUtils;
+
+  public class SkillActionForm extends ActionForm, implements Factory {
+
+      protected List skills = ListUtils.lazyList(new ArrayList(), this);
+
+      public List getSkills() {
+          return skills;
+      }
+
+      public void setSkills(final List newSkills) {
+          skills = ListUtils.lazyList(newSkills, this);
+      }
+
+      // 'Factory' method for LazyList
+      public Object create() {
+          return new SkillBean();
+      }
+
+  }
+
+}}}
+
+
 === LazyDynaBean / LazyValidatorForm ===
 
 '''N.B.''' Solutions here require '''Struts 1.2.4''' and '''Bean Utils 1.7.0'''

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org