Trying to update two fields of a shapefile using a WFS update service published from GeoServer 2.4.3 with OpenLayers 2.13.1. I have a JavaScript with all the OpenLayers fun and a HTML document with all the interface fun. Essentially the user clicks on an object and updates a form and then saves it.
Assuming its possible? It's probably really simple but I can't crack it. The fields do not update and in the demo requests the service times out.
Here is the code I am trying;
function saveHandler() {
newDim = document.getElementById("dimension").value;
var num = parseFloat(newDim);
var newDimRound = num.toFixed(3);
newMaterial = document.getElementById("MaterialDD").value;
var saveDetails = OpenLayers.Request.POST({
url: '<url of wfs service>',
username: '<username>',
password: '<password>',
data: '<wfs:Transaction service="WFS" version="1.1.0"\n' +
'xmlns:topp="http://www.openplans.org/topp"\n' +
'xmlns:ogc="http://www.opengis.net/ogc"\n' +
'xmlns:wfs="http://www.opengis.net/wfs">\n' +
'<wfs:Update typeName="Store:Layer">\n' +
'<wfs:Property>\n' +
'<wfs:Name>Field 1</wfs:Name>\n' +
'<wfs:Value>' + newDimRound + '</wfs:Value>\n' +
'<wfs:Name>Field 2</wfs:Name>\n' +
'<wfs:Value>' + newMaterial + '</wfs:Value>\n' +
'</wfs:Property>\n' +
'<ogc:PropertyIsEqualTo>\n' +
'<ogc:PropertyName>Spatial_ID</ogc:PropertyName>\n' +
'<ogc:Literal>' + getSpatial_ID + '</ogc:Literal>\n' +
'</ogc:PropertyIsEqualTo>\n' +
'</wfs:Update>\n' +
'</wfs:Transaction>\n',
callback: handler
}); // end of Post
function handler(updateSQL) {
alert("Details Saved!")
} // end handler
};
I have tried putting the fields in their own property sections and different orders to no avail.