>Note: this will be this simple only if all your creditCard attributes are
>Strings, otherwise you'll need to resort to PropertyUtils.copyProperties()
>or some homegrown conversion method, I believe.

I have this problem. The attributes are not strings (and they have no useful 
toString() method).

How do I cope with that?

Thanks

Praful
 

-----Original Message-----
From: Taylor, Jason [mailto:jtaylor@;cobaltgroup.com]
Sent: 25 October 2002 18:21
To: 'Struts Users Mailing List'
Subject: RE: Question - DynaActionForm and indexed property


If it's an ArrayList, you'd specify the type as "java.util.ArrayList"

-----Original Message-----
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Friday, October 25, 2002 8:00 AM
To: Struts Users Mailing List
Subject: RE: Question - DynaActionForm and indexed property


does that type format of <class>[] apply to Arrays and Lists?

-----Original Message-----
From: Taylor, Jason [mailto:jtaylor@;cobaltgroup.com]
Sent: Friday, October 25, 2002 10:42
To: 'Struts Users Mailing List'
Subject: RE: Question - DynaActionForm and indexed property


hope you're using struts 1.1-- you're going to need the "indexed" attribute.
Here's the basic idea:

<logic:iterate id="creditCard" name="myForm" property="creditCards">
Type: <html:text name="creditCard" property="type" indexed="true" />
Name: <html:text name="creditCard" property="name" indexed="true" />
...
</logic:iterate>

and

<form-bean name="myForm" type="o.a.s.a.DynaActionForm">
<form-property name="creditCards" type="com.ra.ic.model.CreditCard[]" />
</form-bean>

Note: this will be this simple only if all your creditCard attributes are
Strings, otherwise you'll need to resort to PropertyUtils.copyProperties()
or some homegrown conversion method, I believe.

-JT

-----Original Message-----
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Friday, October 25, 2002 7:15 AM
To: Struts Users Mailing List
Subject: Question - DynaActionForm and indexed property


I am trying to setup a DynaActionForm to use indexed and named properties.
But I'm getting an error and, not knowing BeanUtils very well, I'm wondering
if someone can guide me in what I need to do to make this work.

In my form...
<html:text property='creditCard[0].type' />
<html:text property='creditCard[0].name' />
<html:text property='creditCard[0].number' />
<html:text property='creditCard[0].expDate' />

In my struts-config.xml...
<form-property name='creditCard[0].type' type='com.ra.ic.model.CreditCard'
/>
<form-property name='creditCard[0].name' type='com.ra.ic.model.CreditCard'
/>
<form-property name='creditCard[0].number' type='com.ra.ic.model.CreditCard'
/>
<form-property name='creditCard[0].expDate'
type='com.ra.ic.model.CreditCard' />

CreditCard has get/set methods for type, name, number, expDate.

The error I'm getting is...
javax.servlet.jsp.JspException:
No getter method for property creditCard[0].type of bean
org.apache.struts.taglib.html.BEAN
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:742)





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



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

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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

Reply via email to