redirect to mendix page with javascript

1
Hello, Is it possible to redirect a user to a mendix page in javascript? (the equivalent of a show page in a microflow)   Thanks
asked
4 answers
2
mx.ui.openForm('MyFirstModule/Page1.page.xml', {
    location: "popup",
    callback: function(form) {
        console.log(form.id);
    }
)

https://apidocs.rnd.mendix.com/8/client/mx.ui.html

 

answered
3

You can also add a URL attribute to the page (for example ‘mypage1’) and use

localhost:8080/p/mypage1

in Andrej’s javascript (you have the leave the localhost out but this is easier to read and test)

This is easier to maintain.

answered
2

I did do this. 

 

I used a link that included parameters of the id of a certain entity that I needed. 

example /?RequestId=31&Page=Request

I then used js to parse the parameters. from window.location.href;

I then cleared the location (if you dont, the nanoflow you use on the homepage will just keep getting triggered)

After I did this, I dynamically passed the page name and the request needed using what andrew pointed out.

 

mx.ui.openForm('MyFirstModule/Page1.page.xml', {
    location: "popup",
    callback: function(form) {
        console.log(form.id);
    }
)

That should be about it.

 

answered
0

What about if the mendix page expects parameters? How to pass the parameters into this page within the javascript action?

answered