| Author |
Have any problem using validator
|
Sunil George
Greenhorn
Joined: Apr 04, 2006
Posts: 18
|
|
|
I am currently working on a Struts application. For form variable validation we use javascript instead of validator. Is there any problem using validator?
|
 |
poornima balagopal
Ranch Hand
Joined: Dec 02, 2003
Posts: 83
|
|
Hi there is no problem in using validator. Most of the general validations we need to performs for the fields in the form, have been covered by validation.You just need to associate your fields with the required validations in your application level validation.xml file. regards Poornima
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
|
One problem with Struts validation is that it doesn't do client-side (JavaScript) validation for indexed properties.
|
Merrill
Consultant, Sima Solutions
|
 |
yin jiang
Greenhorn
Joined: Mar 28, 2006
Posts: 7
|
|
Struts validation do client-side (JavaScript) validation for indexed properties too. you can write your validation.xml file as this : <field property="approver[0]" depends="short"> <msg name="short" key="errors.user.id.not.int"/> </field> <field property="approver[1]" depends="short"> <msg name="short" key="errors.user.id.not.int"/> </field> One problem I am facing now is the client-side validation will import all validate scripts even if you don't need them. It will make your HTML page very big.
|
My English is poor. Sigh!!!
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
This method is still unacceptably awkward for me, since I have no idea how many rows there will be in a dynamic table at run time. If I have 500 rows, am I going to repeat this code 500 times? As I see it, the only acceptable solution for client-side validation of indexed properties is to write my own javascript code.
|
 |
Sunil George
Greenhorn
Joined: Apr 04, 2006
Posts: 18
|
|
|
Thank you all for your messages. Have any performance issue using validator?
|
 |
 |
|
|
subject: Have any problem using validator
|
|
|