Hi Anand,
Can you post an example of a Form Bean source code which supports all
the primitive types that you mentioned. The reason i asked this is...i want
to know if in the setter/getter methods i have to do the appropriate
conversions or not. Thanks.
cheers,
Amar..
-----Original Message-----
From: Anand Raman [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 12:25 AM
Cc: [EMAIL PROTECTED]
Subject: Re: ActionForm question (repost)
Hi Bryan
I have used both primitive data types like int, float, boolean and
String objects in the ActionForm class..
It has been working fine.. Meaning that a text filed which is filled
with a numeric value populates the primitive setter method
appropriatly.. The same happens in the case of a String too..
However a blank field will be set as a "" and not a null..
U will have expicitly perform this check (if u need so) in the setter or
the Action class.
Hope this helps
Anand
On Thu, Mar 08, 2001 at 09:43:48AM -0700, Bryan Field-Elliot wrote:
>Question reposted (never got any responses) -- please respond, someone :)
>
>Question about creating ActionForm beans --
>
>What kinds of data types are supported? I could not find a reference to
>this in the docs. For example, I want to have an input box on my forms,
>where the user can enter a number. Or, they can leave it blank. I want
>"blank" to show up as null, not zero. Should I implement my ActionForm
>bean as follows?
>
>Integer qty;
>
>Integer getQty() { return qty; }
>void setQty(Integer) { this.qty = qty; }
>
>I've chosen Integer because it can hold a value, OR it can be null
>(which is the behavior I'm looking for).
>
>Will this work, or must I restrict my data types to Strings and do
>conversion somewhere else?
>
>Thanks,
>Bryan