Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts and YUI Connection Manager

 
m nhk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need help with a web application I'm working on where I'm replacing its html frames with div layers and utilizing the YUI connection manager to update the appropriate div layers.

The application framework is struts2 which needs to remain, as all of the application relies on the struts tags.

When submitting a form in the application I have included a Javascript call which uses the yui connection manager to call the action form and method which gets back the correct response from the server, however after the javascript executes, the struts framework kicks in and submits the form thus updating the whole page with the response rather than just a particular div layer.

So apart from removing the struts tags in the jsp's, which isn't really an option as this would require the whole front end to be re-written, does anyone know how I can stop struts submitting the form or intercept it to forward its reponse into the YUI Connection Manager? (YUI Connection Manager can use POST and GET)

Thanks
M
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want the normal HTML form submission to take place the onsubmit JavaScript function should return "false".

This isn't Struts-specific.
 
m nhk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much David you have saved me a lot of work for something so simple! And appologies for not posting it in the right place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic