Have variable page properties contained within a page - Mendix Forum

Have variable page properties contained within a page

5

Oftentimes when you want the user to have some control over dynamic view properties on a page, you are forced to use some kind of ViewHelper entity. You'll create a ViewHelper containing the view properties, put some kind of DS_ViewHelper in a dataview on the page and have the user manipulate the ViewHelper attributes to change the displayed page. This always feels like a workaround and rather outdated.

My suggestion is to have a Page contain variables within itself. Page Variables can be changed in Microflows and are persisted throughout a session. You can configure the available variables in the Page Properties window. They can be simple types such as boolean, enumerations, integers, etc. Microflows and Nanoflows contain a ‘Change Page’ action where you can change the page variables. Show Page Action also contains variable configuration.

If you want to persist view settings between sessions, you can save properties in the Account entity. Once a page is shown, you can retrieve the current account, and call a Show Page action where you'll set the page properties from the attributes directly.

Variable configuration in Page Properties:

 

Show page with variables as parameters:

asked
0 answers