Hi<div>I was in Foss4G Barcelona and got this great tutorial on GeoExt Editng.</div><div>And it works very well on shape-files in geoserver.</div><div>But we want to use postGIS and have tried to make a testtable like this.</div>
<div><br></div><div><div> Column | Type |</div><div>Modifiers </div><div>--------+-----------------------+---------------------------------------</div><div>--------+-----------------------+-----------------------</div>
<div> fid | integer | not null default</div><div>nextval('test.wfstrans2_fid_seq'::regclass)</div><div> info | character varying(40) | </div><div> geo | geometry | </div><div>Indexes:</div>
<div> "wfstrans2_pkey" PRIMARY KEY, btree (fid)</div><div> "geoidx_test__wfstrans2" gist (geo)</div><div>Check constraints:</div><div> "enforce_dims_geo" CHECK (st_ndims(geo) = 2)</div>
<div> "enforce_geotype_geo" CHECK (geometrytype(geo) = 'POLYGON'::text OR geo IS NULL)</div><div> "enforce_srid_geo" CHECK (st_srid(geo) = 32632)</div></div><div><br></div><div><br></div>
<div>The client posts this:</div><div><br></div><div><code class="focusRow subFocusRow "><wfs:Transaction xmlns:wfs="<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a>" service="WFS" version="1.0.0" xsi:schemaLocation</code><code class="focusRow subFocusRow ">="<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> <a href="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd</a>" xmlns:xsi="http</code><code class="focusRow subFocusRow ">://<a href="http://www.w3.org/2001/XMLSchema-instance">www.w3.org/2001/XMLSchema-instance</a>"><wfs:Insert><feature:wfstrans2 xmlns:feature="<a href="http://www.skogoglandskap">http://www.skogoglandskap</a></code><code class="focusRow subFocusRow ">.no"><feature:geo><gml:MultiPolygon xmlns:gml="<a href="http://www.opengis.net/gml">http://www.opengis.net/gml</a>" srsName="EPSG:32632"><gml</code><code class="focusRow subFocusRow ">:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs=","</code><code class="focusRow subFocusRow "> ts=" ">523671.86,6839648 447847.86,6788196 558875.86,6790904 523671.86,6839648</gml:coordinates></gml</code><code class="focusRow subFocusRow ">:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></feature:geo</code><code class="focusRow subFocusRow ">><feature:info>test1</feature:info></feature:wfstrans2></wfs:Insert></wfs:Transaction></code></div>
<div><code class="focusRow subFocusRow "><br></code></div><div><code class="focusRow subFocusRow "><br></code></div><div><code class="focusRow subFocusRow ">And i get this errormessage:</code></div><div><code class="focusRow subFocusRow "><br>
</code></div><div><code class="focusRow subFocusRow "><div selected class="netInfoResponseText netInfoText "><pre><code tabindex="0" class="wrappedText focusRow a11yModified"><?xml version="1.0" encoding="UTF-8"?><wfs:WFS_TransactionResponse version="1.0.0" xmlns:wfs="http:/</code><code class="wrappedText focusRow">/<a href="http://www.opengis.net/wfs">www.opengis.net/wfs</a>" xmlns:ogc="<a href="http://www.opengis.net/ogc">http://www.opengis.net/ogc</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"</code><code class="wrappedText focusRow"> xsi:schemaLocation="<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> <a href="http://kartutv7:80/geoserver_intern/schemas/wfs/1.0.0">http://kartutv7:80/geoserver_intern/schemas/wfs/1.0.0</a></code><code class="wrappedText focusRow">/WFS-transaction.xsd"><wfs:InsertResult><ogc:FeatureId fid="none"/></wfs:InsertResult> <wfs:TransactionResult</code><code tabindex="-1" class="wrappedText focusRow a11yModified">> <wfs:Status> <wfs:FAILED/> </wfs:Status> <wfs:Message>Error performing insert</wfs:Message> </wfs:TransactionResult</code><code class="wrappedText focusRow">></wfs:WFS_TransactionResponse></code></pre>
<pre><code class="wrappedText focusRow"><br></code></pre><pre><code class="wrappedText focusRow">My wfs_editor.html looks like this:</code></pre><pre><code class="wrappedText focusRow">
</code><html>
<head>
<title>GeoExt WFS Editor</title>
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
<script src="openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript" src="geoext/lib/GeoExt.js"></script>
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif";
Ext.onReady(function() {
                                                        
                        /*var saveStrategy = new OpenLayers.Strategy.Save({
                                onCommit: function() {
                                        saveStrategy.layer.refresh();
                                }
                        });*/
                        var saveStrategy = new OpenLayers.Strategy.Save();
                        var baseLayer = new OpenLayers.Layer.WMS( "Gråtone", "<a href="http://kart7.skogoglandskap.no/bakgrunn/wms.topo2.graatone">http://kart7.skogoglandskap.no/bakgrunn/wms.topo2.graatone</a>",
                                        {layers: 'topo2_graatone_WMS', 'format':'image/png', 'transparent':'false' },
                                        {isBaseLayer: true, singleTile: true, buffer:0,ratio:1});
                        var layer = new OpenLayers.Layer.Vector("vector", {
                                strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
                                //strategies: [new OpenLayers.Strategy.Fixed()],
                                protocol: new OpenLayers.Protocol.WFS({
                                        url: "/geoserver_intern/wms",
                                        version: "1.0.0",
                                        geometryName: "geo",
                                        featureType: "wfstrans2",
                                        featureNS: "<a href="http://www.skogoglandskap.no">http://www.skogoglandskap.no</a>",
                                        srsName: "EPSG:32632"
                                })
                        });
var store = new GeoExt.data.FeatureStore({
fields: [
{name: "info", type: "string"}/*,
                                        {name: "fid", type: "int"}*/
],
layer: layer,
                                addFeatureFilter: function(feature) {
                                        return feature.state !== OpenLayers.State.DELETE;
                                }
});
                        
                        var drawControl = new OpenLayers.Control.DrawFeature(
                                layer,
                                OpenLayers.Handler.Polygon,
                                {handlerOptions: {multi: true}}
                        );
                        
                        var mapPanel = new GeoExt.MapPanel({
                                title: "Map",
                                region: "west",
                                width: 400,
                                layers: [baseLayer,layer],
                                //extent: new OpenLayers.Bounds(234758, 6402776, 1339075, 8020511),
                                map: {
                                        projection: new OpenLayers.Projection("EPSG:32632"),
                                        displayProjection: new OpenLayers.Projection("EPSG:32632"),
                                        maxExtent: new OpenLayers.Bounds(-570684.15,6424344.35,1596363.87,7964447.65),
                                        units: "m",
                                        maxResolution: 2708.0,
                                 numZoomLevels: 15,
                                        controls: [ new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.MousePosition({'prefix':'UTM 32: ','numDigits':0})
                                        ]
                                },
                                bbar: [
                                        new GeoExt.Action({
                                                control: drawControl,
                                                text: "Create",
                                                enableToggle: true
                                        }), {
                                                text: "Delete",
                                                handler: function() {
                                                        gridPanel.getSelectionModel().each(function(rec) {
                                                                var feature = rec.get("feature");
                                                                modifyControl.unselectFeature(feature);
                                                                store.remove(rec);
                                                                if(feature.state !== OpenLayers.State.INSERT) {
                                                                        feature.state = OpenLayers.State.DELETE;
                                                                        layer.addFeatures([feature]);
                                                                }
                                                        });
                                                }
                                        }, "->", {
                                                text: "Save",
                                                handler: function() {
                                                        store.commitChanges();
                                                        saveStrategy.save();
                                                }
                                        }
                                ]
                        });
                        
                        mapPanel.map.addControl(drawControl);
                        
                        var modifyControl = new OpenLayers.Control.ModifyFeature(layer);
                        mapPanel.map.addControl(modifyControl);
                        modifyControl.activate();
var gridPanel = new Ext.grid.EditorGridPanel({
                                title: "Feature Table - Manhattan (NY) landmarks",
                                region: "center",
                                viewConfig: {forceFit: true},
                                store: store,
                                listeners: {
                                        afteredit: function(e) {
                                                var feature = e.record.get("feature");
                                                if(feature.state !== OpenLayers.State.INSERT) {
                                                        feature.state = OpenLayers.State.UPDATE;
                                                }
                                        }
                                },
                                sm: new GeoExt.grid.FeatureSelectionModel({
                                        selectControl: modifyControl.selectControl,
                                        singleSelect: true
                                }),
                                cm: new Ext.grid.ColumnModel({
                                        defaults: {
                                                sortable: true,
                                                editor: {xtype: "textfield"}
                                        },
                                        columns: [
                                                {header: "Info", dataIndex: "info"}/*,
                                                {header: "Id", dataIndex: "fid"}*/
                                        ]
                                })
                        });
var mainPanel = new Ext.Panel({
renderTo: document.body,
layout: "border",
height: 450,
width: 800,
items: [gridPanel, mapPanel]
});
});
</script>
</head>
<body>
</body>
</html>
</pre><pre><code class="wrappedText focusRow"><br></code></pre><pre><code class="wrappedText focusRow"><br></code></pre><pre><code class="wrappedText focusRow">I am running geoserver 2.0.0</code></pre><pre><code class="wrappedText focusRow">Anyone knows whats wrong.</code></pre>
<pre><code class="wrappedText focusRow"><br></code></pre><pre><code class="wrappedText focusRow">Best regards </code></pre><pre><code class="wrappedText focusRow">Viggo Lunde</code></pre><pre><code class="wrappedText focusRow">Skog og landskap</code></pre>
<pre><code class="wrappedText focusRow">Norway</code></pre></div></code></div><div><code class="focusRow subFocusRow "><br></code></div><div><code class="focusRow subFocusRow "><br></code></div><div><code class="focusRow subFocusRow "><br>
</code></div>