You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stjepan Brbot <st...@ht.hr> on 2004/04/12 01:26:07 UTC

Re: DynaValidatorActionForm validation order of operations?

I don't know how does it work with DynaValidatorActionForm (I guess the same as with DynaValidatorForm) but DynaValidatorForm (Struts v1.1) shows all validation errors (for all fields in form) in only one round-trip. Do you use Struts v1.0 or v1.1?

SB

"Hodgeman, Robert (LNG)" <Ro...@lexisnexis.com> wrote in message news:42B8643373BD554EBBF2AA0AEA8776001590C3@LNXDAYEXCH01.lexis-nexis.com...
> I've got validation working for several forms.  I have noticed, however,
> that there is a definite order to things regarding validation.  And, it
> seems somewhat cumbersome from a user perspective (IMHO).  I'm looking for
> input on how to improve the situation either by using a different
> configuration or defining my own validation class(es) or something.
> 
> I've got a form with two fields.  Both fields (field1 and field2) are
> required, but field2 also needs to be an integer within a certain range.  If
> I (the user) enter an invalid value for field2 while leaving field1 empty, I
> am returned to the form and notified that field1 is required.  I am NOT also
> told that field2 was invalid.  So, I (the user) fill in field1 and resubmit
> the form ... only to be returned AGAIN to the form and told that field2 is
> invalid (having not changed the existing field2 value from my first submit).
> 
> Is this by design?  It would be useful in my application to be able to tell
> the user in one round-trip that one required field is missing, PLUS the data
> provided in another field is invalid (out-of-range ... not a number, etc.).
> 
> Thoughts?  Does that make any sense?  I can provide applicable
> struts-config.xml and validator.xml excerpts, but I didn't think it was
> really necessary (unless this really is just a configuration problem).
> 
> Thanks in advance.
> 
> -Bob Hodgeman


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


Re: DynaValidatorActionForm

Posted by Shahriar Jamshidi <sh...@returnity.com.au>.
I dont think DynaActionForm will help you in what your trying to do.
 From what I understand DynaActionForm is an actionForm where the elements are
defined in the struts-config file rather than in you own java code.

(Ie you dont have to write java class that extends actionForm and make 
getValue() setValue() for your elements,
you just use a DynaActionForm and define the values in the 
struts-config.xml file.)

I have had the need to make forms with dynamic numbers of Elements too, but 
I have yet to find a struts method to assist me in doing this. I usually 
resort to using the HttpServletRequest and using getParameters() and 
finding the dynamic parameters from there.

(If anyone knows of a struts method for using dynamic numbers of elements 
I'd also be interested).

Regards

Shahriar

At 08:54 13/04/2004 +0800, you wrote:

>Dear All,
>
>We are trying to implement all ActionForm in our project by
>DynaActionForm.
>But we are not able to use DynaActionForm, where there are dynamic
>number of rows on the page eg in case of purchase order we don't know
>how many line items will be there.
>
>Can anybody please help me in doing it.
>
>Regards
>Shoaib
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org


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


Re: DynaValidatorActionForm

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Take a look at the LazyValidatorForm I wrote - specifically the get(String
name, int index)  method handles this scenario.

http://www.niallp.pwp.blueyonder.co.uk


Niall

----- Original Message ----- 
From: "Shoaib" <sh...@vmoksha.com>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Tuesday, April 13, 2004 1:54 AM
Subject: DynaValidatorActionForm


>
> Dear All,
>
> We are trying to implement all ActionForm in our project by
> DynaActionForm.
> But we are not able to use DynaActionForm, where there are dynamic
> number of rows on the page eg in case of purchase order we don't know
> how many line items will be there.
>
> Can anybody please help me in doing it.
>
> Regards
> Shoaib
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



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


DynaValidatorActionForm

Posted by Shoaib <sh...@vmoksha.com>.
Dear All,

We are trying to implement all ActionForm in our project by
DynaActionForm.
But we are not able to use DynaActionForm, where there are dynamic
number of rows on the page eg in case of purchase order we don't know
how many line items will be there.

Can anybody please help me in doing it.

Regards
Shoaib


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