table creation using Iterate
Hi I have been getting helped out with couple of struts users. I have a question on the table population using Iterate tags. When I use Iterate all I obtain is the table populated with different rows. Is there any way to get the length of the bean so that I can have three columns and as many rows. For example currently I get data in jsp in only one column with 5 rows(bean length=5). I want to write it into two rows with three in each row. Please throw me your ideas. thanx. - Do You Yahoo!? Yahoo! Health - your guide to health and wellness
RE: table creation using Iterate
Well, there is a size tag you can use to get the size of a collection. What you do with it, or how you use it to layout your table is up to you. -AP_ http://www.alexparansky.com Java/J2EE Architect/Consultant http://www.myprofiles.com/member/profile/apara_personal -Original Message- From: Hari Menon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 2:27 PM To: [EMAIL PROTECTED] Subject: table creation using Iterate Hi I have been getting helped out with couple of struts users. I have a question on the table population using Iterate tags. When I use Iterate all I obtain is the table populated with different rows. Is there any way to get the length of the bean so that I can have three columns and as many rows. For example currently I get data in jsp in only one column with 5 rows(bean length=5). I want to write it into two rows with three in each row. Please throw me your ideas. thanx. - Do You Yahoo!? Yahoo! Health - your guide to health and wellness -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: table creation using Iterate
I am probably oversimplify your question, but do you mean something like table tr tdbean:write name=MyBean property=prop1/td tdbean:write name=MyBean property=prop2/td tdbean:write name=MyBean property=prop3/td /tr tr ... ? -Original Message- From: Hari Menon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 5:27 PM To: [EMAIL PROTECTED] Subject: table creation using Iterate Hi I have been getting helped out with couple of struts users. I have a question on the table population using Iterate tags. When I use Iterate all I obtain is the table populated with different rows. Is there any way to get the length of the bean so that I can have three columns and as many rows. For example currently I get data in jsp in only one column with 5 rows(bean length=5). I want to write it into two rows with three in each row. Please throw me your ideas. thanx. - Do You Yahoo!? Yahoo! Health - your guide to health and wellness -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: table creation using Iterate
To do things such as this, I think most folks typically have a bean that models one row of data and then stuff them all into a Vector. You can then iterate over your Vector and use jsp property-getter tags to retrieve the values for the current column from the bean. If that's as clear as mud to you, perhaps looking through some examples would help. My suggestion would be unpack the struts-tiles.war file and look at the layouts there. Ignore the scriplet stuff - it's a necessary evil in the case of part of the layouts. Unless you have multiple lists you need to iterate simultaneously (which is when he uses them) it's not necessary to do as he has done. HTH, Eddie - Original Message - From: Hari Menon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 4:26 PM Subject: table creation using Iterate Hi I have been getting helped out with couple of struts users. I have a question on the table population using Iterate tags. When I use Iterate all I obtain is the table populated with different rows. Is there any way to get the length of the bean so that I can have three columns and as many rows. For example currently I get data in jsp in only one column with 5 rows(bean length=5). I want to write it into two rows with three in each row. Please throw me your ideas. thanx. - Do You Yahoo!? Yahoo! Health - your guide to health and wellness -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]