Back Forum Reply New

Spring JS with lt;form:formgt; tags

I'm planning to build forms using the lt;form:formgt; tag and some JS - the interesting JS/AJAX part I'd like to implement is extending the form by some dropdown's, checkboxes, etc. dynamically. Like having a form to edit a user account and a possibility to add some HTML items describing e.g. some permissions I'm willing to add/remove. Is it somehow possible with Spring JS? The only thing I've seen in the spring webflow reference guide is to use some decorations. I'd like to add lt;form:...gt; tags dynamically - of course, I can do that imitating Spring by inserting e.g. html lt;input gt; lt;labelgt; ... tags the way spring tag's would render the lt;form:..gt; tag , but I'd prefer to avoid it if there's a better way

Btw, what about springmodules-xt? I've seen the last release is from March 2008, could I use it together with spring 2.5 and annotation based controllers? I'm wondering how I could get the AJAX interceptor working, I assume using aspects, yet, I've no idea where should be the pointcut (controller method?). Anyway, thanks for any hints regarding dynamic lt;form:form'sgt;, I'm pretty  sure a lot of such applications was built..  

hello,

i never used springmodules-xt, so i skip that part of the question.

About Spring JS and lt;form:formgt; tags:the spring form tag library produces the common html form element (like input, select, etc). (this means after rendering the jsp the lt;formgt; tags don't exist any longer, this also means you can't add lt;form:...gt; tags dynamically in the view with javascript )

So if you add some html form elements to the view using javascript with the correct name and value, they will be sent to the server like the other elements and they will be picked up by spring binding etc.

But since you use spring js , you can use dojo to facilitate the proces of creating / adding the html form elements

I hope this answers you question

Thanks, I'm not using Spring JS yet, still considering if it's worth it. I've done a few tests with adding manually html lt;inputgt; etc elements and it works fine, I think I'll stick to this solution.
¥
Back Forum Reply New