I know this question seems already asked.. But i surfed through the websites and i did not get any clarification. Here is my question.
I have two web pages. Call them as page1.jsp and page2.jsp.
I am having a table in my page1.jsp. Please refer the image
And in my page2.jsp i am having an input field like in the following image
Now I need to display the the respective docId in the textarea which i am clicking in the page1.jsp.
For example if i am clicking 00001 in page1.jsp i needs to redirect to page2.jsp and 00001 should be updated textarea of in page2.jsp
the script i used in page1.jsp is
$('.pending_list').click(function(){
var row = $(this).closest("tr");
var text = row.find(".pending_list").text();
alert(text);
var DocNo = text;
$('.pending_list').attr({
href:"${loginbean.contextPath}/effortloading/search"
});
});
Here is my page2.jsp
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<div class="row padding6">
<div
class="col-lg-4 col-md-4 col-sm-4 col-xs-12 margintop8 rq-field">
<!-- for field required notification-->
<spring:message text="Doc No" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<form:input id="docID" path="DOC_ID" name="DOC_ID" type="text"
class="form-control" />
<form:errors path="userTitle" class="control-label" />
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12"></div>
</div>
</div>
Controller
@RequestMapping(value = "/effortloading/search", method = RequestMethod.GET)
public String effortloadingsearch(@Valid @ModelAttribute("loginbean") Loginbean loginbean,EffortLoadingBean effortBean, Model model,BindingResult result){
model.addAttribute("effortloadingedit", effortBean);
return "EffortLoadingSearch";
}
I hope my question is understandable. Thanks in advance