• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

DropDown selected value to be transfered to action in spring

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP:

<form:form modelAttribute="firstVO" method="post">

<form:select path="secondVO.status"
id="status" >
<form : option value="all" label="All" />
<form : option value="new" label="New" />
</form:select>

<input type="button" name="search" value="Search" onclick="filterData();" />

</form:form>

function filterData(){

document.forms[0].action = Path+"/filter.do";
document.forms[0].submit();
}
-------------------------------------------------

public class FirstVO {

private SecondVO secondVO;
}


public class SecondVO {

private String status;
}

public class DPSController {

@RequestMapping(value = "/filter.do")
public ModelAndView filterDashboard(HttpServletRequest request, @ModelAttribute SecondVO secondVO) {
System.out.println("secondVO.getStatus:"+secondVO.getStatus());
}
}

From jsp i need to transfer the value selected in drop down when a user click on search button which is submitting the form.

Note: DPSController is the action class which is printing the status selected value.

Any idea please?

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

I think we need PropertyEditorSupport class to be extended in order to active init binding.
please have a look at this.

Thanks

Ayan
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic