Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a controller method without reloading whole page

 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • 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.
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://directwebremoting.org/dwr/documentation/server/integration/spring.html

Use annotations
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic