[OpenLayers-Users] Custom save values - WFS
Eric Lemoine
eric.lemoine at camptocamp.com
Tue Jun 22 00:46:20 EDT 2010
On Monday, June 21, 2010, giraam <sdjbm17 at gmail.com> wrote:
>
> I'm thinking on something like this! Let me know if you have a better opinion
> or correct me if I'm wrong:
>
>
> var_number = 9; // just an example
>
> function setDetails() {
> feats = pdv_nuevo.features;
> for(i = 0; i < feats.length; i++) {
> feats[i].attributes.COD_PULP = var_number;
> }
> }
>
>
> So I call this function before I save the changes like this:
>
>
> toolbar.addControl(
> new OpenLayers.Control.Button({
> title: "Guardar",
> trigger: function() {
> setDetails();
> saveStrategy.save();
> }
> }),{
> iconCls: 'salvar'
> });
>
>
> What do you think?!
Hi. It looks good to me. Alternatively you could register a "start"
listener on the save strategy and modify your feature attributes in
there.
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list