[OpenLayers-Users] argument type for the save callback of SaveStratgy

Eric Lemoine eric.lemoine at camptocamp.com
Wed Aug 3 01:34:01 EDT 2011


On Wed, Jul 27, 2011 at 1:02 AM, Dave Potts <dave.potts at pinan.co.uk> wrote:
> Hi list
>
> I am trying to work out what type off information is supplied to the
> success/fail callback functions of the saveSrategy.
>
> Looking in the source code at line 229 of Save.js in openlayers 2.10
> suggests that a response(i.e.OpenLayers.Protocol.Response)  style argument
> should be expected.
>
> But looking at the data supplied for the save callback function gives the
> following types.
>
>
> "response" value="[object Object]"
> "object" value="[object Object]"
> "element" value="null"
> "type" value="success"
>
> Which does not look like a OpenLayers.Protocol.Response object, any
> suggestions as to what is going on here?

The Events.triggerEvent function adds "object", "element", and "type"
properties to the event object provided by the caller. To get the
Response instance in callback functions use evt.response, where evt is
the first (and only) argument of your callback. Hope this clarifies
things.



-- 
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