thankyou for your response and clear expaination.

If I use String for the formbean do I have to convert it to Double before i validate?

Is there an easier way to convert all form-properties in the form at the same time?

Thanks.


From: "Hubert Rabago" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: formbean of double type value chages when submitting the form
Date: Fri, 24 Mar 2006 08:17:04 -0600

You know, you're right.  I don't know why we list those there since
DynaActionForm can support any type.  (pause, think.)  Hmm, maybe next
week I'll find time to fix that. (Patches to docs are welcome!)

Anyway, I think you missed a statement a few paragraphs down the same
section: "And, of course, while the DynaActionForm may support various
binary types, properties used with the html:text tag should still be
String properties."

Going back on topic, you can use whatever type you need in
DynaActionForm as long as you know what you're doing and you can
handle the consequences.  Laurie's option 1 is an example of handling
it yourself, although now that I think about it, I think
FormPropertyConfig is the one that replaces the null with "new
Double()" which is where you get your "0.0".  Ahh, I'll have to look
again to see how you can intercept this.

So, bottom line, yes, you can put whatever type in Dyna*Form fields
you want.  I sometimes put other Dyna*Form objects in them.  If you
do, though, you'll have to know how to handle them yourself.  The
default form handle only handles Strings and booleans.

Hubert

On 3/24/06, fea jabi <[EMAIL PROTECTED]> wrote:
> so, I should have all form-properties to be of String type and convert to
> Double and then validate is it?
>
> if that is the case then, why do we have the below data types? what is it's
> purpose?
>
> http://struts.apache.org/struts-action/userGuide/building_controller.html
>
> The types supported by DynaActionForm include:
>
> java.math.BigDecimal
> java.math.BigInteger
> boolean and java.lang.Boolean
> byte and java.lang.Byte
> char and java.lang.Character
> java.lang.Class
> double and java.lang.Double
> float and java.lang.Float
> int and java.lang.Integer
> long and java.lang.Long
> short and java.lang.Short
> java.lang.String
> java.sql.Date
> java.sql.Time
> java.sql.Timestamp
>
>
> Thanks.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to