• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 and ajax issue

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,
I'm not sure if anyone has run into this issue but if anyone can help would gladly appreciate. I am using Struts2 and prototype for this web application that I am developing. On the page I have some div's that get populated with html fragments from a jsp page after an AjaxRequest call. The html fragment that is returned to populate the div is just an html form asking a question. After the user selects submit an action is called where there is some validation done on the requests. If there is an error however when the page is returned I am only seeing the one question with html form fragment. I don't see the other questions. so I guess my question is is there a way to just refresh the div and not return a new page with just the one question. Can the struts.xml file call a javascript/AjaxRequest function so that only the div gets refreshed and not the whole page? Let me know if you need me to provide more information. Any help again would be appreciated. Thanks.






 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajax form submits can optionally refresh just a div: http://struts.apache.org/2.1.6/docs/dojo-submit.html
 
Alex Acev
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for responding so promptly David. The link you provided deals with using the Dojo framework. I am currenlty using the prototype framework for this web app. Is refreshing just a div still possible if we are using the prototype framework and not dojo?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"ace ace", please check your private messages for an important administrative matter.
 
Alex Acev
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess no one has an answer to this one?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use whatever framework you want, but the Dojo tags work with Dojo. If you're using something non-Dojo then obviously the tags won't work, but you can still do things however you'd do things normally.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic