Refresh application

1
Maybe this should be common knowlege and I just missed it somewhere, as I see a lot of reference in the forum to 'just refresh the application', but with no explanation of how this is done. How is this done? What I'm trying to do is have an anonymous user select a language and then have the page refresh so it is then displayed in that language. I can see that it works if I have the user select a language and then I manually refresh the page using the refresh button or Ctrl-R, but I cannot figure out how to automatically refresh the page when the user selects a language, in such a way that the language is updated for all elements on the page. Can anybody help with this?
asked
5 answers
2

Our solution is to open a popup with a widget that executes some javascript code:

window.location.reload(false);

 

answered
1

Ok, what I ended up doing in this case is giving the second page in the process a URL, then on the first page, I put the language selection and a normal html link to the second page via the URL. So when you select the language, it sets it for the anonymous user, and then when you click the link, since it is a normal http request, the whole page is loaded instead of just dynamically loading the content into the existing page. Then everything continues in the selected language from there.

This seems to work pretty well, at least in this case. I was never able to get the entire page to reload from a microflow, perhaps just because of how the page is designed, I'm not sure.

answered
1

I'm not sure if this works for when a user changes their language but I would recommend that if you want to perform a refresh that you make use of the Mendix client api: 

mx.ui.reload(callback) - this will reload your current form, where as if you do Window.location.reaload you really do a hard reload of the page. In most cases the mx.ui.reload is good enough and keeps the user within the correct form. 

 

Here is the docs: https://apidocs.mendix.com/6/client/mx.ui.html

 

answered
0

The answer @Fabian gave is a good way to do it but if you are working in Mendix anyway, why don't you just refresh the parent dataview object?

answered
0

This might help you:

https://appstore.home.mendix.com/link/app/112595/

answered