How to add (multiple) Persons to a location?

1
Dear developers, I am a starter in developing apps with mendix but I have the following case I need you guys to help me out with because I can't come further. I have created these entities. Here Administrators can add locations (for example: A factory somewhere in germany and where workers need to build a new facility. Here Administrators can add workers who later on should be added to a location. My question is how can I add those workers to a location? I want to be able to see later on which workers are working at which location, just by selecting the location or by selecting the worker I want to see on which location he is working. I have provided some screenshots with explanation.
asked
1 answers
3

Niels,

Your domain model associations are incorrect. Remove them both, and replace by drawing an association from Person to Location. That should create a 1-* association, which means that 1 location can have multiple people working there.

Now, on the Persons page, under "User details", add a reference selector widget in the lower section, and use the connector to select your association. That will let you set your Person's associated location.

On your Locations page, add a data grid inside "Location details" and select your data source over database, from the Location to your new association, to Person.

If this isn't making any sense to you, I highly recommend the Getting Started training, and the free Intro Course. If you are interested in classroom training, take a look here. The live intro course is extremely valuable in getting started with Mendix.

answered