display the name of the current user in the index page

2
I want to display the name of the current user in every page in the header as in the current page of the forum and when click on the user link ,he can go to edit his account. I know that I have to write a code like the following in the index.html as follow '<div class="MxClient_LoginButton" id="MxClient_LoginButton" dojoType="mendix.widget.LoginButton"></div> and adding this class 'MxClient_LoginButton' in the custom.css but it does not work with me ! I think this is a basic feature which should be available in mendix without need to add a login button widget to the home page or to add it manually in every page.
asked
4 answers
0

What errors do you get in Firebug? In general you cant just throw some widgets in index.html, since there is a very specific lifecycle in which widgets are started and things like context and session are applied (the user session is not directly available after the index.html has been loaded).

Further you did not define the attributes such as caption, microflow actions and rendertype, so the widget might not be able to start at all.

I suggest either filing a feature request to support this by default, or to file a support request.

answered
2

Did you make sure that the widget is included on at least one form so it is compiled when starting the server. We have done something similar by adding widgets to the toolbar in the index.html. This didn't work either at firsts because the widget added wasn't included on any form. We now have the widget on a form that is never shown to the user but is taken into account when starting the server.

answered
0

I think it's not a basic feature, because I would prefer to set it manually, based on the needs of my customer.

answered
0

I need step by step answer about this simple feature that I want to apply. I added code like this in the index.html

<div class="MxClient_toolbar" id="MxClient_toolbar" dojoType="mendix.widget.MxToolbar"> <div class="MxClient_LoginButton" id="MxClient_LoginButton" dojoType="LoginButton.widget.LoginButton"></div> </div>

  • then I added empty class in the custom.css .MxClient_LoginButton{}
  • what I made wrong?
answered