Custom widget in theme doesnt refresh

4
I have developed (actually migrated to 2.5) two custom widgets: one to display a user welcome message and one to display the current application version. Both are not 'standard' widgets used in the content of the application, but are instead used in the MxClient_headerPane div of the theme. Now my problem: The new login procedure in Mendix is quite different in version 2.5. It detects if you have a valid user session and if not, it blocks further interaction with the application and dynamically generates a blocking login popup using JavaScript. After login, you are allowed back to interact with the application. If user A logs in for the first time (no cached resources in the browser) the welcome user widget shows 'Welcome user A', which is correct. However, if user A logs out and user B logs in (with the same browser) he is also welcomed with 'Welcome user A', which is of course incorrect. A refresh using F5 reloads the header pane and thus the welcome widget, making it display the correct message. I can understand why this happens: the Ajax nature of the Mendix client caches the static HTML page (which contains the widgets) between logins. However, this doesn't work as desired. Any ideas? Kind regards, Jonathan van Alteren - FlowFabric
asked
2 answers
5

When switching users, the reload method is invoked on all widgets. To refresh your widget, just implement this method, and refresh the data.

answered
2

Just a WAG here as this is not an area of expertise for me, but have you looked at the HideFooter widget from the AppStore? This uses javascript to show or hide the footer pane. Could you use something similar to re-build the header pane whenever you need to?

answered