Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

emulate auto postback with struts?

Thread view: 
Elhanan - 18 Dec 2005 20:12 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.