struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: Iterator Problem: how to get the changed values ?
Date Wed, 04 Apr 2007 16:42:13 GMT
--- Syed Ibrahim <syed.ibrahim@paradyne.co.in> wrote:
> I am using iterator to list some values in textfilds
> in tabular format, following way.
> 
> <s:iterator value="myList">
> 	<s:properties value="Id"/>	
> 	<s:textfield value="%{name}"
> </s:iterator>
> 
> How can I achieve that in Struts 2 ?

You should be able to just make myList be something
List-y (and if you use generics I don't think you need
to do anything w/ the conversion properties file) and
use the status.index to create array-ish property
names.

<s:iterator value="beanList" status="stat">
  <s:textfield name="beanList[%{stat.index}].propName"
/>
</s:iterator>

(Or something like that; I don't have any of my code
in front of me, but hopefully that's enough to get you
started :/

See:

http://struts.apache.org/2.x/docs/type-conversion.html

d.



 
____________________________________________________________________________________
Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

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


Mime
View raw message