Mendix Form onload,onleave actions

1
Hello, I need to notify somehow when a form has been loaded on hidden. Actually when I enter a form I need to use HTML snippet to do something. The idea is like the following: We have a theme which takes a space from the page, as you know; we have only one page for the whole application, for one Mendix form; I need to consume this space so I could remove the header at runtime using java script snippet, but I need to return the header back when the user clicks back or close the form. Hopefully it is clear. Thanks
asked
3 answers
1

Take a look at this Footer Toggle widget in the app store. This allows you to show or hide the footer div. If you amend this to operate on the header div, you should be able to control on which pages the header is shown.

answered
2

You can indeed use the Footer Toggle as a starting point. Create a widget that hides the header. On uninitialize display the header again and call layout to recalc the screen.

shared.div = dojo.query(".HeaderUniqueSomething")[0];
shared.div.style.display = "block" ;
mx.screen.layout();

Put the widget on the forms that needs extra space.

I use a project-specific widget for that, I can send it you if you want.

answered
1

Basel,

You could use the microlfow timer widget from the app store to trigger a microflow when the form is opened. For the app store description:

"Open a form and directly trigger validation errors. (to achieve this, use interval: 0, execute once: true, start at once: true) (new in 1.2)"

Maybe this can help in solving your challenge?

answered