I started working with Mendix this week and im looking for a way to link a user to an object from an entity. The application that im making is a soccer-app. Players can login and click a “I will attend next game”-button so that I can get a list of players who will attend next game. The problem is that i don’t know how to create a login form using the authentication widgets from mendix themselve, how do i check username and password. I guess you can’t simply create a login-button, reference it to a microflow and inside the microflow you check the following: - loop through all players (they have a username and password) and check if there is a matching username. - Check the password associated with that username if it’s correct then what? How can i say that that specific user (that logged in) clicked the attendance-button? The result i want to get is: John Doe logs into the system. He clicks the button “I will attend next game”. By doing so he (entity player) will be added as an object to entity “participants”.
Mendix by default hadles the login. You first have to set your project security level to production.
For your games and attendees i would create the following domain model. Account already exist in the administration module. This way a user can attend to multiple games and a game can have multipe attendees.
You should be able to create a microflow where you create a attendee object which you link to the current users account and the game he wants to attend. Since this is basic mendix, I think its a good start to follow the different learning paths. YOu can find them on https://academy.mendix.com.
Maybe something like this?
- User Login
- Show a list of available games (Event) to select from
- a button “I will attend this game” – add them to the List of Attendees on click
As for ‘How can i say that that specific user (that logged in) clicked the attendance-button?’
You could either go with audit log from the app store or simply by checking ‘owner’ depending your need