You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heligon Sandra <sa...@thomson.net> on 2004/10/19 09:53:58 UTC

Nested tables and Map

	Hi,

	I would like to add a 'nested table' in my Struts application.
	
	<<Year>>	<<Type>>	<<Song>>
					<<Author>>  	<<Title>>

	1980		Pop		 Titi		 A
					 Toto		 B
	
	I should make hyper link on the 'Title' column. And when the user 
	select a 'song' I should retrun in the hyper link the name of the song
	and the 'year'. I know that display tag has limitations, 
	does somebody know if it is possible ?
				
	I have a first Map 'Years' each object of this Map has a Map <Songs>.

	I know that display tag allows to do 'nested tables' but I don't find a complete example
	with struts-config.xml, action.java and JSP page.
	
	I think that this tag use only ArrayList or Vector, isn't it ?

	Is there an other tag that allows to do this with Map object ?

	Thanks a lot in advance.
	
	 

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


Re: Nested tables and Map

Posted by Erik Weber <er...@mindspring.com>.
Why couldn't you use the c:forEach or logic:iterate tags to accomplish this?

I used nested c:forEach tags to iterate a Map of Lists and render nested 
tables. Each key in the Map was the name of a "type". Each value was a 
List of beans of that type. So I first had an outer table, with one row 
for each type. Each of those rows was actually a nested table, with one 
row for each bean of the current type.

type1 (outer table, row 1)

  bean1 (nested table, row 1)

  bean2

  bean3

type2 (outer table, row 2)

  bean1

  bean2

  bean3

type3

  bean1

  bean2

  bean3


I could edit this and send it to you if you think it would help.

Erik



Heligon Sandra wrote:

>	Hi,
>
>	I would like to add a 'nested table' in my Struts application.
>	
>	<<Year>>	<<Type>>	<<Song>>
>					<<Author>>  	<<Title>>
>
>	1980		Pop		 Titi		 A
>					 Toto		 B
>	
>	I should make hyper link on the 'Title' column. And when the user 
>	select a 'song' I should retrun in the hyper link the name of the song
>	and the 'year'. I know that display tag has limitations, 
>	does somebody know if it is possible ?
>				
>	I have a first Map 'Years' each object of this Map has a Map <Songs>.
>
>	I know that display tag allows to do 'nested tables' but I don't find a complete example
>	with struts-config.xml, action.java and JSP page.
>	
>	I think that this tag use only ArrayList or Vector, isn't it ?
>
>	Is there an other tag that allows to do this with Map object ?
>
>	Thanks a lot in advance.
>	
>	 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

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