[OpenLayers-Users] Feature's attributes

Tim Schaub tschaub at opengeo.org
Thu Oct 23 16:43:54 EDT 2008


Hey-

Alexandre Dube wrote:
> I must be close to the answer.
> 
> It looks like OL uses this GML portion of the INSERT response right 
> after the data has been saved to parse the currently null "fid"...
> 
> <wfs:InsertResults>
>   <wfs:Feature>
>     <ogc:FeatureId fid="restricted.62"/>
>   </wfs:Feature>
> </wfs:InsertResults>
> 
> Unfortunately, tinyows currently returns has 
> <wfs:InsertResult></wfs:InsertResult>, even though the INSERT was a 
> success.   So I'm unable to interact more with the saved feature unless 
> I refresh the page ( the getFeature parse correctly the fid then ).
> 

If the insert is really getting persisted, then this sounds like a 
tinyows bug.

If the insert is not persisted, we can check to confirm that the 
transaction is valid.  If it is valid, it is a tinyows issue.  If it is 
not valid, it is an OpenLayers issue.

Tim

> Alexandre
> 
> Alexandre Dube wrote:
>> In the example : feature.fid before INSERT is null, but as something after.
>> In my app : feature.fid is null before AND after.  But as soon as I 
>> refresh the page, its has something.
>>
>> ??
>>
>> Alexandre Dube wrote:
>>   
>>> Hi list,
>>>
>>>   I'm using WFS Protocol to INSERT, DELETE and UPDATE features.  So far, 
>>> I've been able to INSERT geometry and DELETE.  Now, I'd like to add some 
>>> attributes with an html form.  I was wondering if there's already 
>>> something for that in OL, something that takes care of parsing 
>>> attributes to a feature.  I tried feature.attributes['attribute_name'] = 
>>> "some text" and it works, but doesn't seem ok to me.
>>>
>>>   I also noticed that when I INSERT a new geometry, it doesn't gets its 
>>> 'gid' attribute.  It only appears when I refresh the page.  Should that 
>>> attribute be saved to the feature's attributes at the same time they are 
>>> INSERTed ?  I look the WFS-Transaction example (3) and noticed that 
>>> there's no 'gid' attribute anywhere...
>>>
>>>   Also, if I (1) INSERT then try immediately to UPDATE, I get an error 
>>> 500.  But if (2) I refresh then UPDATE, no error 500 ( I can go beyond 
>>> that error, well I get an other one but it doesn't matter right 
>>> now....)  I think it has more something to do with the "fid" in the GML 
>>> as follow :
>>>
>>>   >(1) My first GML ( that's not working ) has :<ogc:FeatureId/>
>>>   >(2) My second GML ( working ) has <ogc:FeatureId 
>>> fid="bdga_route_l_arc.7199"/>
>>>   >(3) And the example has :<ogc:FeatureId fid="restricted.55"/>, even 
>>> if it has no attributes !
>>>
>>> Any hints ?
>>>
>>>   
>>>     
>>
>>   
> 
> 


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Users mailing list