Make it possible to use constants in a visibility-condition. - Mendix Forum

Make it possible to use constants in a visibility-condition.

28

This idea proposes to make it possible to use constants in a visibility-condition.

Currently for setting the visibility on a page element, you can not use constants:

Asking my colleagues, they mentioned one possible justification for this: prevent passwords stored in contants to get exposed to the frontend. And indeed you never should expose any password. But should we therefor prohibit constants in visibility-condition? No, the password-argument is no reason to prohibit using constants as visibilty-condition entirely. For instance, as you can see in the given example's screenshot, it can be very useful when checking if it is your production environment or not. It might even be useful to add a 'Allow clientside exposure'-boolean to the data-type 'constant', like Robert's suggestion.

Therefor: Make it possible to use constants in a visibility-condition.

Edited: And since constants are available outside any Context-Entity, we might even improve the 'Condition for visibility'-popup with a separate option for constants.

asked
4 answers

Running into this one as well. Especially the ‘development mode’ or ‘production mode’ logic. Very useful for conditional visibility. Would definitely be good to have it.

Created

Interestingly, I came to the forum just now to post the exact same idea. This would make a huge difference for one of our current projects.

Bonus points if this visibility setting can (in the future) be applied to grid columns as well.

Created

+1 for Robert's suggestion as well.

Created

I think there should be an option to have 'public' constants and 'private' constants. The private ones are the ones that we use right now. And the public ones are things like IsProduction or DTAPMode, which you could use in the UI/Nanoflows as well.

Created