ivosturm / GoogleMapsCustomMarker

Extended functionality for the Mendix GoogleMaps widget including drag and drop, markerclustering and customization of markers
0 stars 4 forks source link

Non-Persistent Entity as ContextObject for DS-MF #17

Closed kesslera closed 6 years ago

kesslera commented 6 years ago

Hi, why is it not possible to have a non-persistent entity as contextobject for the datasource microflow?

Scenario: I want to develop a map view with a dropdown, where the user can choose via dropdown, which markers are shown.

Best regards, Alex

ivosturm commented 6 years ago

Hi Alex,

Can you give a bit more context? Is the context object the marker itself or some entity you have coupled to some markers as some kind of mapping entity?

A picture of the set-up in Mendix you have would help sorting this out.

Kind regards, Ivo

Van: Alexander Keßler notifications@github.com Verzonden: maandag 19 november 2018 09:34 Aan: ivosturm/GoogleMapsCustomMarker GoogleMapsCustomMarker@noreply.github.com CC: Subscribed subscribed@noreply.github.com Onderwerp: [ivosturm/GoogleMapsCustomMarker] Non-Persistent Entity as ContextObject for DS-MF (#17)

Hi, why is it not possible to have a non-persistent entity as contextobject for the datasource microflow?

Scenario: I want to develop a map view with a dropdown, where the user can choose via dropdown, which markers are shown.

Best regards, Alex

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ivosturm/GoogleMapsCustomMarker/issues/17, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANZk2nS44UI1zl4is0oqhDTpPgzn9nvuks5uwm0UgaJpZM4YooD5.

kesslera commented 6 years ago

Hi Ivo, thanks for the fast reply. The contextObject is just a generic container with only an enumeration as attribute displayed as dropdown. On change of the dropdown, the microflow should retrieve all Workorder-Objects with the exact same enumeration value as the contextObject and create the MapMarkers on the fly. This works fine for now, as I have changed the entities from non-persistent to persistent and I just don't commit them to the database. But this is just some dirty workaround. It would "feel better" if the objects were non-persistent.

Enclosed you will find some screenshots to give you more context. mapcontainer_screenshot map_screenshot dm_screenshot

ivosturm commented 6 years ago

Hi Alex,

I just updated the widget. Can you verify whether version 3.1.0 caters for your needs? I tested with a full non-persistent domain model and it worked.

Let me know!

Kind regards, Ivo

Van: Alexander Keßler notifications@github.com Verzonden: maandag 19 november 2018 10:27 Aan: ivosturm/GoogleMapsCustomMarker GoogleMapsCustomMarker@noreply.github.com CC: Ivo Sturm ivo.sturm@firstconsulting.nl; Comment comment@noreply.github.com Onderwerp: Re: [ivosturm/GoogleMapsCustomMarker] Non-Persistent Entity as ContextObject for DS-MF (#17)

Hi Ivo, thanks for the fast reply. The contextObject is just a generic container with only an enumeration as attribute displayed as dropdown. On change of the dropdown, the microflow should retrieve all Workorder-Objects with the exact same enumeration value as the contextObject and create the MapMarkers on the fly. This works fine for now, as I have changed the entities from non-persistent to persistent and I just don't commit them to the database. But this is just some dirty workaround. It would "feel better" if the objects were non-persistent.

Enclosed you will find some screenshots to give you more context. [mapcontainer_screenshot]https://user-images.githubusercontent.com/22537650/48697337-ae0da200-ebe4-11e8-960d-db5cd3259b3d.png [map_screenshot]https://user-images.githubusercontent.com/22537650/48697663-676c7780-ebe5-11e8-9773-313069ac91f8.png [dm_screenshot]https://user-images.githubusercontent.com/22537650/48697700-8408af80-ebe5-11e8-9aa2-97030e40d181.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ivosturm/GoogleMapsCustomMarker/issues/17#issuecomment-439826104, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANZk2nGJij6Yuc3cbSaXgoR3dTN_hXu9ks5uwnlkgaJpZM4YooD5.

kesslera commented 6 years ago

Hi Ivo, nice work! Now the widget is working like a charm.

Thank you very much

kesslera commented 6 years ago

Sorry to bother you again, but I've found another issue. Just wanted to show some data in the info bubble of the marker and tried to select an attribute from a persistent entity associated to the non-persistent mapmarker.

Mendix Modeler is showing me following error: mapmarkerattribute_screenshot

ivosturm commented 6 years ago

Can't you add that attribute to be filled in the non-persistent MAP.MapMarker? Else the widget should do possibly a database retrieve for the I believe Partner of the Workorder for the location.

Most of the times -for performance reasons- it is best to create the NP entities with all attributes filled already, so the widget itself does not need extra database retrieves.

Is this an option?

kesslera commented 6 years ago

Yes it is an option. Solved the problem like you've described. Thanks again.