javascript - Converting dojo.xhrGet to dojo/request/xhr for Struts2 -
i have following code passes code , objectids traildesignations.action correctly.
updatetraildesignationgridclass = function(){ this.updatetraildesignationgrid = function(){ var value1 = 35; var xhrargs = { url: "/trails/traildesignations.action", handleas: "text", preventcache: true, content: { code: value1, objectids: "35.36" }, load: function(data){ featureresultscontent.innerhtml = data; }, error: function(error){ featureresultscontent.innerhtml = "an unexpected error occurred: " + error; } }; // call asynchronous xhrget var deferred = dojo.xhrget(xhrargs); }; }; but since xhrget deprecated trying same thing dojo/request/xhr using following code.
updatetraildesignationgridclass = function(){ this.updatetraildesignationgrid = function(){ var value1 = 35; xhr("/trails/traildesignations.action",{ data:{ code: value1, objectids: "35.36" }, preventcache: true }).then(function(data){ featureresultscontent.innerhtml = data; },function(err){ featureresultscontent.innerhtml = "an unexpected error occurred: " + error; }); }; }; with new code data not passed code , objectids fields. used same struts action in both cases.
<action name="traildesignations" class="gov.mo.dnr.tis.map.traildesignations"> <result name="success" type="stream"> <param name="contenttype">text/html</param> <param name="inputname">inputstream</param> </result> </action> i did information traildesignations.action.
Comments
Post a Comment