Forum


13:50

14/08/2011

Can somebody help me PLEASE!!!!. I have spend a whole day and a sleepless night trying to work out why my grid data is not posted to the server. I desparately need some help here!!!!!
I am fetching data from a java servlet in json format and it comes up fine on the grid. But when I edit and hit submit/enter, I can see the editUrl being invoked through the http server monitor tool in the netbeans IDE. I have specfied the editUrl as a java servlet and I have implemented the servlet as well.
So the post is being invoked. But no data is being posted. i was expecting them to be posted as query parameters but the http monitor tool is saying "No data posted with this request". I have tried all the exampes but still no luck. All the documentation says the edited form data is posted to the server automatically as query parameters. Can someone please help. Here is the code for my page with the jqgrid constructor. Could someone PLEASE PLEASE PLEASE help. This is driving me crazy.....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Field Inspection</title>
<link rel="stylesheet" type="text/css" media="screen" href="resources/css/ui-lightness/jquery-ui-1.8.15.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="resources/css/ui.jqgrid.css" />
<script src="resources/js/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="resources/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="resources/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="resources/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
var mygrid = jQuery("#ProgramOfWork");
var lastSel;
mygrid.jqGrid({
url: 'FetchProgOfWork',
datatype: "json",
height: 225,
rowNum: 10,
rowList: [10,20,30],
jsonReader :
{
root:"ProgOfWorkData",
page: "currpage",
total: "totalpages",
records: "totalrecords",
id: "PROG_ID",
repeatitems: false
},
colModel:[
{name:'MAP_NO',index:'MAP_NO', width:100, editable:true},
{name:'PROG_DATE',index:'PROG_DATE', width:100, editable:true, classes:'dtPicker',editoptions:{ dataInit:function (elem) { $(elem).datepicker({dateFormat: 'M-yy'}) } }},
{name:'STATUS',index:'STATUS', width:100, editable:true, edittype:"select",editoptions:{value:"NEW:NEW;SCOPING:SCOPING;INWORK:INWORK;AUDIT:AUDIT;CLOSED:CLOSED"}},
{name:'INSP_TYPE',index:'INSP_TYPE', width:100, editable:true, edittype:"select",editoptions:{value:"VEGMGNT:VEGMGNT;SRVLINEINSP:SRVLINEINSP"}},
{name:'FIELD_USER',index:'FIELD_USER', width:100, editable:true, edittype:"select", editoptions: {value:"reddyr: Rahul Reddy"}},
{name:'START_DATE',index:'START_DATE', width:100, editable:true, classes:'dtPicker',editoptions:{ dataInit:function (elem) { $(elem).datepicker({dateFormat: 'd-M-yy'}) } }},
{name:'END_DATE',index:'END_DATE', width:100, editable:true, classes:'dtPicker',editoptions:{ dataInit:function (elem) { $(elem).datepicker({dateFormat: 'd-M-yy'}) } }},
{name:'SCOPE_COMP_DATE',index:'SCOPE_COMP_DATE', width:100, editable:true, classes:'dtPicker',editoptions:{ dataInit:function (elem) { $(elem).datepicker({dateFormat: 'd-M-yy'}) } }},
{name:'WORK_COMP_DATE',index:'WORK_COMP_DATE', width:100, editable:true, classes:'dtPicker',editoptions:{ dataInit:function (elem) { $(elem).datepicker({dateFormat: 'd-M-yy'}) } }},
{name:'AUDIT_COMP_DATE',index:'AUDIT_COMP_DATE', width:100, editable:true, classes:'dtPicker',editoptions:{ dataInit:function (elem) { $(elem).datepicker({dateFormat: 'd-M-yy'}) } }},
{name:'COMMENTS',index:'COMMENTS', width:150, editable:true, edittype:"textarea", editoptions: {rows:"1"}},
{name:'DESPATCH',index:'DESPATCH', width:60}
],
editurl: 'UpdateProgOfWork',
loadonce: true,
gridComplete: function()
{
var ids = jQuery("#ProgramOfWork").jqGrid('getDataIDs');
for (var i = 0; i < ids.length; i++)
{
var cl = ids[i];
de = "<input type='button' value='SEND' onclick='despatchProgOfWork('" + cl + "' );' />";
jQuery("#ProgramOfWork").jqGrid('setRowData', ids[i], { DESPATCH: de });
}
},
onSelectRow: function(id) {
if (id && id !== lastSel) {
mygrid.jqGrid('restoreRow',lastSel);
var cmMapNo = mygrid.jqGrid('getColProp','MAP_NO');
var cmpProgDate = mygrid.jqGrid('getColProp','PROG_DATE');
var cmInspType = mygrid.jqGrid('getColProp','INSP_TYPE');
cmMapNo.editable = false;
cmpProgDate.editable = false;
cmInspType.editable = false;
mygrid.jqGrid('editRow', id, true, null, null, 'UpdateProgOfWork');
cmMapNo.editable = true;
cmpProgDate.editable = true;
cmInspType.editable = true;
lastSel = id;
}
},
pager: "#ProgramOfWorkFooter",
viewrecords: true,
gridview:true,
multiselect: false,
caption: "Program Of Work"
});
jQuery("#ProgramOfWork").jqGrid('navGrid','#ProgramOfWorkFooter',
{ edit: true, add: true, del: false, search: true, refresh:true },
{
recreateForm: true,
beforeShowForm: function(form)
{
$('#tr_MAP_NO', form).hide();
$('#tr_PROG_DATE', form).hide();
$('#tr_INSP_TYPE', form).hide();
}
},
{
recreateForm: true,
beforeShowForm: function(form)
{
$('#tr_MAP_NO', form).show();
$('#tr_PROG_DATE', form).show();
$('#tr_INSP_TYPE', form).show();
}
},
{},
{multipleSearch:true, multipleGroup:true} );
jQuery("#ProgramOfWork").jqGrid('filterToolbar');
jQuery("#ProgramOfWork").jqGrid('navButtonAdd',"#ProgramOfWorkFooter",{caption:"Toggle",title:"Toggle Search Toolbar", buttonicon :'ui-icon-pin-s', onClickButton:function(){ mygrid[0].toggleToolbar() } });
jQuery("#ProgramOfWork").jqGrid('navButtonAdd',"#ProgramOfWorkFooter",{caption:"Clear",title:"Clear Search",buttonicon :'ui-icon-refresh', onClickButton:function(){ mygrid[0].clearToolbar() } });
mygrid[0].toggleToolbar();
});
function despatchProgOfWork(PROG_ID)
{
// Make an ajav call to fetch the required XML payload.
// Post the XML payload to the PUSH API for device magig from the client
// Proxy access is no issue because it's automatically using the end user's
// internet proxy.'
};
</script>
</head>
<body>
<table id="ProgramOfWork"><tr><td/></tr></table>
<div id="ProgramOfWorkFooter"></div>
</body>
</html>
17:11

14/08/2011

One more thing I notice. If I enter an invalid url, the page comes back with the error but when I examine the http request in the http server monitor tool, this time the query parameters are comming across.
Don't understand what's going on here. iT works for an invalid url but does NOT work for a valid URL!!!!!!
Is this a problem with the server side being a servlet?
Most Users Ever Online: 715
Currently Online:
97 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66