hi..
i'm just getting into html names space of struts ui, and i think i
understand why is everyone talking about page level events vs request
events.
is it possible do an auto post back emulation of say a country and city
combo boxes, for example clicking on a country combo willl couse the
page the reload with cities relavent to the country selected?, i guess
there should be a java script on click event on the combo the will
submit, but theres only one submit in struts, (i think) and this submit
should process the full request, while the in autopostback the page
might not be fillled completly to be validated.
another thing is ,that auto validator also works on page level, is it
possible to make it work on the the fields level (on blur)?
Tim Terry - 18 Dec 2005 22:35 GMT
> hi..
>
[quoted text clipped - 12 lines]
> another thing is ,that auto validator also works on page level, is it
> possible to make it work on the the fields level (on blur)?
i think you can get round the struts validation problem by using the
'validwhen' operation. This will enable you to validate fields depending
of the value of another field.
see http://struts.apache.org/struts-doc-1.2.x/userGuide/dev_validator.html
Tim
Elhanan - 19 Dec 2005 06:17 GMT
thanks, i didn't know that, this may eliminated completly the need to
use validate method, but i was talking about another thing, can i have
the java script validate function be executed as soon as i leave a
field instead of waiting for submit.
Tim Terry - 19 Dec 2005 19:20 GMT
> thanks, i didn't know that, this may eliminated completly the need to
> use validate method, but i was talking about another thing, can i have
> the java script validate function be executed as soon as i leave a
> field instead of waiting for submit.
in short yes, but you may need to grow your own. I know that struts
comes wth a javascript validation tag
(http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#javascript)
it may be possible to call the functions it generates from a form
element's onchange event. Although I haven't used this tag before so its
just an idea.
Tim
Elhanan - 24 Dec 2005 19:38 GMT
thanks i saw this tag before, if i'm not mistaken it simply generates
the entire function for validation ALL the form, so if i place it the
field's onblur event it will try to validate the entire form, i guess i
wanna have JSF with struts.