Date: 2004-10-02T10:29:22 Editor: HubertRabago <[EMAIL PROTECTED]> Wiki: Apache Struts Wiki Page: StrutsCatalogLazyList URL: http://wiki.apache.org/struts/StrutsCatalogLazyList
Introduce the nested tags alternative. Change Log: ------------------------------------------------------------------------------ @@ -33,6 +33,20 @@ When the form is submitted BeanUtils will first call the getSkills(index) method to retrieve the indexed bean followed by setSkillId(..) on the retrieved bean. + +=== Using nested tags === + +An easy-to-use alternative to the html iterate tag and indexed attribute are the nested tags. The nested tag equivalent of the example above would be: + +{{{ + <nested:iterate property="skills"> + <nested:text property="skillId"/> + </nested:iterate> +}}} + +The generated html would be the same. + + == Lazy List Behaviour == A common problem with indexed properties, is that people then get "index out of range" errors with ActionForms that are in Request scope. The indexed property (List or Array) needs to be able to automatically ''grow'' during the ActionForm population process. The key to achieving this is in the getXXXX(index) method. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]