Wendy

One vote for three pre-populated boxes. Saves on validation that way :)

Brian

----- Original Message -----
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 3:18 PM
Subject: Dates & validation


>
> Do most people allow users to type in a complete free-form text date?  Or
do
> you give them three boxes where they must put in month day and year
> separately?
>
> I'm trying to come to terms with validation.  I can't turn on the
automatic
> validation <action validate="true" ... > because the users are allowed to
> leave the form before it's complete and come back to it.  Will I still be
> able to use the plug-in Validator?  (All the actions in the
struts-validator
> example have 'validate' this turned on. :(
>
> I have the DAO layer that takes an internal format date (# of days since
> 1960-something) to my Value Object which now has a java.sql.Date:
> contactVO.setActualDate( java.sql.Date.valueOf( uSession.oconv(
> udArray.extract( 16 ), "D4-YMD" ).toString() ) );
>
> But here's where I get lost.  In order to copy the properties back and
forth
> from Value Object to ActionForm, the types have to match.  (Don't they?)
But
> if I put a java.sql.Date into my ActionForm, then it will blow up when the
> user types 7/13/1985 rather than 1985-07-13 and submits the form.
>
> So, I need a String property in the ActionForm, and ... some special
> something that turns it into a java.sql.Date but will not blow up if the
> input is wrong?
>
> I'm going in circles.  Any advice is appreciated!  (Should I not be using
> java.sql.date?)  I did search for 'struts date validation' with Google,
but
> didn't find an answer.
>
> --
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
>


--
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