'Value returns null after passing from javascript to Modify action class in struts
This dropdown element will call this javascript function
function updateFields(val) {
var objData = new kendo.data.DataSource({
transport : {
read : {
url : "Modify.do?command.do(getInfo)",
dataType : "json",
cache : false,
beforeSend : function(req) {
req.setRequestHeader('isAjaxRequest', "true");
}
},
parameterMap : function(data, action) {
if (action === "read") {
var stateId = $("#sending").val();
console.log('----'+ id);
return "req-id=" + id;
} else {
return data;
}
}
},
});
Was able to call this Modify Action class and try getting the id via request get attribute but the value returns null.
Long Id = (Long) request.getAttribute("id");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
