Storing the result of the Where am I?-Button

0
I'm trying to build a mobile page that stores the location of the user in the system as the location of an object that the user is currently transporting. To do this I've created a class "Container" which has a "Location"-object attached to it. In a Data View showing the Container object I've nested a Data View showing the Location object, retrieved by association. The Location's Data View has a little Google Map in it and a button "Where am I?" Both the map and the button have their latitude and longitude fields set to the Location object and in addition the "Where am I?"-button has the option to specify a microflow that reveives the Location object as its parameter. If I specify no microflow, an empty one and a flow with just a message popping up displaying the values of the latitude and longitude fields the form and message show me the correct location: upon clicking "Where am I?" the map moves from the old point to my current location and the message in the microflow shows my new coordinates. A short test reveals that the Location object passed is not a newly created object but is in fact the Location that is correctly associated with the Container. When I try to save the objects either by a save button in the Location-dataview and/or in the Container-dataview, restart Mendix and try again it has thrown away my current location and has reverted back to the old locaton. When I try to commit the location object in the microflow from the "Where am I?"-button, not only does that not save the new location, it also immediately shows the old location on the map as soon as the microflow is executed (repeatedly clicking the button shows the map switching quickly). I'm wondering how to fix this: how to store the coordinates I get in my microflow parameter without breaking everything? If anyone can shed a light on this: please do!
asked
0 answers