Finally the problem melted down.. i am now able to validate the form by ajax, field level with out the page refresh. Thanks to 'Vita Rara' -the info was vital in achieving this.
Some how i strongly feel error in js files (jira). So the steps go as follows:
Some how i strongly feel error in js files (jira). So the steps go as follows:
- created a new theme cajax (custom ajax) 'Vita Rara'
- create a directory template/cajax in ur java source (src/)
- explode struts-core.jar and...
- copy the struts2-core-2.0.9\template\ajax\* into cajax folder. For struts 2.0.9 there are abt 21 files
- go to the jsp and in context create a folders scripts, scripts/ajax, scripts/xhtml in it. The idea is that the url: http://site:8080/context/scripts should show the script files.
- copy the validation.js (s) from struts2-core-2.0.9\template\xhtml and struts2-core-2.0.9\template\ajax into the into
- copy clientValidation.js from struts2-core-2.0.9\org\apache\struts2\static\ to scripts folder of step 3
- This completes the basic infrastructure required to get things.
- register the theme (prop file)
- Mainly we need to provide checkbox handling in the js
- modify the form.ftl etc ftls to take this js instead of the once in the struts-core.jar
No comments:
Post a Comment