I have the following code which passes the code
and objectIds
to 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 the asynchronous xhrGet
var deferred = dojo.xhrGet(xhrArgs);
};
};
But since xhrGet
is deprecated I am trying to do the same thing with dojo/request/xhr
using the 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 the new code the data is not passed to the code
and objectIds
fields. I used the 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 get information back from trailDesignations.action
.