[OpenLayers-Users] Can't update a feature for which there is no FID (WFS-T)

paweluz paweluz at o2.pl
Wed Feb 10 08:37:02 EST 2010


Hi!

I have problem with WFS-T ADD state. I my application the user is able to
add, update and delete a feature from map. The problem appears if:
1. User draw new geometry on map, fill out the attributes of new object and
click SAVE to database.
2. Then user click on the new object on map. The attributes of the object
appear.
3. User is trying to modify or delete the object... Then I got an alert
Can't update a feature for which there is no FID 
I check it in firebug, and the FID is null. Why is that... The real funny
think is that when I change the zoom of the map, or click F5, or in layer
switch a uncheck and check my wfs_layer, the FID of my new object is changed
to correct!! Now the user is able to remove or change the geometry (object)
on map. Did anyone have this problem?
Here is code for adding new object into the database

                feature.layer.eraseFeatures([feature]);
                feature.geometry = new OpenLayers.Geometry.MultiLineString(
                    feature.geometry
                );
				selectedfeature=feature;
                feature.state = OpenLayers.State.INSERT;
                feature.layer.drawFeature(feature);
                my_wfslayer.commit();


If I add the line  my_wfslayer.refresh();  at the end I got response
(SUCCEED), my layer is refreshed but I can't see my new object (new geometry
does not appear on map). I have to click F5 or zomm in/out or make change in
layer switch(off/on)... What is wrong?

Regards,
Poul
-- 
View this message in context: http://n2.nabble.com/Can-t-update-a-feature-for-which-there-is-no-FID-WFS-T-tp4547884p4547884.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list