• 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

Calling a controller method without reloading whole page

 
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have this form in JSP and Spring framework implementation behind.

In form there are many fields along with two comboboxes(form ,entity) which i want to be loaded dynamically from an object (which gets populated from db through DAO method)
Its like a mapping object which stores this mapping between them .

public class FormToEntityTree {

String formId;

List<String> entityIdList = new ArrayList<String>();

public FormToEntityTree(String formId, List<String> entityIdList) {

this.formId = formId;
this.entityIdList = entityIdList;

}

}
If while filling form, form is changed, entity values changes too.
each form has different entities so i get them filled up in m mapping object so can use it dynamically.

Now ,User has filled up form partially and then thought to chage form type.control goes to controller which loads the values from object and comes back to jsp page..all values go away.
Is there any way using java to call and reload without losing enters fields.
I cannt use jquery or yui but plain javascript is okay.
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please post your JSP and Controller code?
 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi

I am pasting some snippets out of my code.JSp is too big so i pasted just 2 required fields.

 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so why dont you use AJAX.. check out DWR
 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So finally our team decided for ajax. which one is best to start with .Any good tutorials/examples for dwr?
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://directwebremoting.org/dwr/documentation/server/integration/spring.html

Use annotations
 
reply
    Bookmark Topic Watch Topic
  • New Topic