You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Hatton <ch...@qwest.net> on 2003/05/19 23:58:58 UTC

Nested elements and multidimensional arrays

Hi, everyone,

I am correctly using nested iterators to display what is essentially a
2-dimensional array.  I have an ArrayList of Groups (JavaBean) which has
a name and an ArrayList of Items (JavaBeans).

The nested tags successfully display the elements as:

	groups[0].item[0].value
	groups[0].item[1].value
	
	groups[1].item[0].value
	groups[1].item[1].value

	etc.


But I can't figure out how to set up my action mapping to automatically
perform the reconstruction of the 2-D array for me.


Here's an excerpt from my struts-config-xml..

<form-bean 
	name="preferencesForm" 	type="org.apache.struts.action.DynaActionForm">
        <form-property 
		name="configGroups" 		type="com.tobin.tdx.Group[]"/>
</form-bean>
.....
<action
	path="/savePreferences"
	type="com.tobin.tdx.PreferencesAction"
	scope="session"
	parameter="savePreferences"
	name="preferencesForm">
	<forward name="success" path="tdx.config.preferences"/>
</action>


Any ideas?

Thanks in advance!
	Chris Hatton
	Tobin International



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


Re: Nested elements and multidimensional arrays

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hi Chris, use lazylist from commons or do it yourself in the form reset. 
Automatic != possible

Chris Hatton wrote:
> Hi, everyone,
> 
> I am correctly using nested iterators to display what is essentially a
> 2-dimensional array.  I have an ArrayList of Groups (JavaBean) which has
> a name and an ArrayList of Items (JavaBeans).
> 
> The nested tags successfully display the elements as:
> 
> 	groups[0].item[0].value
> 	groups[0].item[1].value
> 	
> 	groups[1].item[0].value
> 	groups[1].item[1].value
> 
> 	etc.
> 
> 
> But I can't figure out how to set up my action mapping to automatically
> perform the reconstruction of the 2-D array for me.
> 
> 
> Here's an excerpt from my struts-config-xml..
> 
> <form-bean 
> 	name="preferencesForm" 	type="org.apache.struts.action.DynaActionForm">
>         <form-property 
> 		name="configGroups" 		type="com.tobin.tdx.Group[]"/>
> </form-bean>
> .....
> <action
> 	path="/savePreferences"
> 	type="com.tobin.tdx.PreferencesAction"
> 	scope="session"
> 	parameter="savePreferences"
> 	name="preferencesForm">
> 	<forward name="success" path="tdx.config.preferences"/>
> </action>
> 
> 
> Any ideas?
> 
> Thanks in advance!
> 	Chris Hatton
> 	Tobin International
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


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