<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello,<br>
<br>
If you look at OpenLayers/Feature/Vector.js, you'll see the
"attributes" property :<br>
<a class="moz-txt-link-freetext" href="http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Feature/Vector-js.html#OpenLayers.Feature.Vector.attributes">http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Feature/Vector-js.html#OpenLayers.Feature.Vector.attributes</a><br>
<br>
It is where the attribute properties describing a feature are
kept. Using Firebug/Any browser dev tool, you can inspect your
layer feature object, using layer.features[0].attributes.<br>
<br>
So, after drawing your feature you could open a popup and
display a form containing the fields you want to have as your
feature attributes. Once done, for each field you would do :<br>
feature.attribute['myfieldname'] = field.value.<br>
<br>
That's basically what the [example] does. If you look at the
[source] code, search for
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
parseFeatureAttributesToForm and
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
parseFormAttributesToFeature methods. This is pretty old stuff,
but you should be able to understand it.<br>
<br>
Let us know if you need more help. It'd be nice to have a small
live demo of your application so that we could see what you're
trying to do.<br>
<br>
[example] <a class="moz-txt-link-freetext" href="http://dev4.mapgears.com/bdga/bdgaWFS-T.html">http://dev4.mapgears.com/bdga/bdgaWFS-T.html</a><br>
[source] <a class="moz-txt-link-freetext" href="http://dev4.mapgears.com/bdga/bdgaRoads.js">http://dev4.mapgears.com/bdga/bdgaRoads.js</a><br>
<br>
HTH,<br>
<br>
Alexandre<br>
<br>
<br>
On 12-11-15 04:04 AM, jannesm wrote:<br>
</div>
<blockquote cite="mid:1352970283063-5016525.post@n6.nabble.com"
type="cite">
<pre wrap="">Any ideas?
I found these links related to the issue, but most are unanswered or the
answer is a bit complex. Is there an easy way to do this?
I want to edit corresponding postgresql data of a vector from
openlayers- how to do it?
<a class="moz-txt-link-freetext" href="http://gis.stackexchange.com/questions/1982/i-want-to-edit-corresponding-postgresql-data-of-a-vector-from-openlayers-how-to?rq=1">http://gis.stackexchange.com/questions/1982/i-want-to-edit-corresponding-postgresql-data-of-a-vector-from-openlayers-how-to?rq=1</a>
How to edit Attributes on WFS Layer through Popup?
<a class="moz-txt-link-freetext" href="http://gis.stackexchange.com/questions/31753/how-to-edit-attributes-on-wfs-layer-through-popup">http://gis.stackexchange.com/questions/31753/how-to-edit-attributes-on-wfs-layer-through-popup</a>
How to edit feature attributes with openlayers?
<a class="moz-txt-link-freetext" href="http://gis.stackexchange.com/questions/30162/how-to-edit-feature-attributes-with-openlayers">http://gis.stackexchange.com/questions/30162/how-to-edit-feature-attributes-with-openlayers</a>
Modify WFS with OpenLayers
<a class="moz-txt-link-freetext" href="http://gis.stackexchange.com/questions/30081/modify-wfs-with-openlayers">http://gis.stackexchange.com/questions/30081/modify-wfs-with-openlayers</a>
adding non spatial attributes using geoserver
<a class="moz-txt-link-freetext" href="http://gis.stackexchange.com/questions/32243/adding-non-spatial-attributes-using-geoserver?rq=1">http://gis.stackexchange.com/questions/32243/adding-non-spatial-attributes-using-geoserver?rq=1</a>
How to insert non-spatial data through WFS-T insert?
<a class="moz-txt-link-freetext" href="http://gis.stackexchange.com/questions/31915/how-to-insert-non-spatial-data-through-wfs-t-insert?rq=1">http://gis.stackexchange.com/questions/31915/how-to-insert-non-spatial-data-through-wfs-t-insert?rq=1</a>
Also an example: <a class="moz-txt-link-freetext" href="http://dev4.mapgears.com/bdga/bdgaWFS-T.html#">http://dev4.mapgears.com/bdga/bdgaWFS-T.html#</a>
--
View this message in context: <a class="moz-txt-link-freetext" href="http://osgeo-org.1560.n6.nabble.com/How-do-I-set-attributes-when-creating-vectors-using-WFS-T-tp5015040p5016525.html">http://osgeo-org.1560.n6.nabble.com/How-do-I-set-attributes-when-creating-vectors-using-WFS-T-tp5015040p5016525.html</a>
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Alexandre Dubé
Mapgears
<a class="moz-txt-link-abbreviated" href="http://www.mapgears.com">www.mapgears.com</a>
</pre>
</body>
</html>