Display UserName (Login Button)

0
Hello everybody, I want to display the user name and his photo on all the pages of my application at the top. For this, I downloaded the Login Button widget and inserted it into the Sidebar Navigation Layout. Unfortunately, it did not work and it gave me this error: "No constructor found for widget LoginButton.widget.LoginButton" Someone can help me? Thank you in advance, Omar.
asked
3 answers
2

Hi Omar,

Place a snippet in your layout. In your snippet place a dataview with datasource microflow. In your microflow retrieve the currentuser (you might need to cast the object to account). Now you can use the text widget or text box widget to display his user name.

answered
0

Hi Omar,

 

You don't need that widget to realize that functionality. Just enable security in your project security settings.

 

This will require the user to login before entering the app. You can create accounts on the accounts_overview page.

 

When a user is logged in you can use the $currentUser variable to know what user is logged in.

 

Good luck!

answered
0

Hi Omar,

Please note that the custom widget for login forms are depricated for Mendix 7 in favor of the  new core widgets for authentication.

https://docs.mendix.com/releasenotes/desktop-modeler/7.0#authentication-widgets

Cheers Andries

answered