emulate auto postback with struts?

E

Elhanan

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)?
 
T

Tim Terry

Elhanan said:
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)?
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
 
E

Elhanan

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

Tim Terry

Elhanan said:
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
 
E

Elhanan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top