i'm planning to do this. when user click course name in the first page, it will go to the second page with the parameter. i've pass the parameter from first page to the controller. but i don't know how to get from the controller? should i use like this? if i use hard coded as below,
var idInput = "123";
var regNoInput = "123";
it will display in the console but not in the display but its okay for the first step.. but when i did like below, it will display null in the console.. please help me.. i'm really need help here.
$('#MregisteredClassesDetails').live('pageshow', function(){
var rowInput = "1";
var pageInput = "1";
var idInput = document.getElementById("courseId");//value take from controller
var regNoInput = document.getElementById("regNo");//value take from controller
$.ajax({
url: '${pageContext.request.contextPath}/getRegisteredClassesDetails.html',
data: ( {rows : rowInput, page : pageInput, courseId : idInput, regNo : regNoInput}),
type: 'POST',
success: function(json_results){
$('#list').append('<ul data-role="listview" data-inset="true"</ul>');
listItems = $('#list').find('ul');
html = '#################################################################################################';
html += '<h1>' +json_results.courseName+'</h1>';
html += '#################################################################################################';
html += '<br> Registration # : '+json_results.regNo+'</br>';
html += '<br> Status : '+json_results.regStatus+'</br>';
html += '<br> Location : '+json_results.courseLoc+'</br>';
html += '<br> Start Date : '+json_results.startDate+'</br>';
html += '<br> Registered Person : '+json_results.fullName+'</br>';
html += '<br> Rate : '+json_results.rate+'</br>';
listItems.append(html);
$('#list ul').listview();
$.mobile.pageLoading(true);
}
});
});
but when i debug in my controller, in the console, both of the parameter is null
2012-05-28 10:35:57,085 DEBUG [http-bio-137.57.102.146-8080-exec-6] TrainingController - courseId:null
2012-05-28 10:35:57,085 DEBUG [http-bio-137.57.102.146-8080-exec-6] TrainingController - registerNo:null
what should i do? i can;t display data if the i fail to retrieve the parameter