Why Do Pop-Ups Only Accept Object Parameters in Mendix?

0
Hello,   I've noticed that when working with pop-ups in Mendix, they only seem to accept object parameters.  Could someone explain why pop-ups in Mendix are restricted to object parameters? Additionally, are there any best practices or workarounds for passing primitive data types (such as strings or integers) to a pop-up?   Thanks in advance!
asked
2 answers
0

Anna,

Mendix was designed that way as far back as I can remember.  However, there are some changes in the works.  The latest release of Mendix adds support for passing primitives from a page to nanoflows and microflows.  In the future, the ability to pass primitives to pages may be added.

 

Current best practice would be to add a non persistable entity to your domain model, create an instance of that entity with the values you need and then pass that to your page.

 

Hope that helps,

Mike 

answered
0

Hey Anna,

Pop-ups accept only object parameters for data management. The design of objects allows  validation and integrity rules across the application.

 

If you need to pass primitive data types, such as strings or integers, to a pop-up, a recommended practice is to create a non-persistent entity.

 

An example would be to create an entity called PopupData with attributes like test and test2. Then, use a microflow to prepare this entity: create an instance of PopupData, set its attributes with the desired primitive data, and open the pop-up with this entity as the object.

 

I hope this helps,

Ricardo Pereira

answered