There are a lot of widgets available in the Mendix Apps- & Add-on Store. Basic display widgets are sufficient for building forms, but sometimes you need a little more kick than what you get from the out-of-the-box widgets. For instance dynamic labels. Creating your own widget is an option, but don’t reinvent the wheel when someone already has, which you’ll find out when you visit the store.
I found Format string and it has some nifty applications. Think of it as an “über-label”, giving your Crud applications a little bit more character in terms of dynamic display. Its handy for dynamic label messages or basic reporting, by allowing you to format a string; very much in the same way we do logging-style messages in Mendix apps. You do this by setting a format string and replacement parameters.
Here is an example. I have a customer as an entity on my form. Instead of displaying a read-only Name and Surname Text box, you simply add the label and use the token place-holders:
Under Data source in the property panel, you select your attributes:
You could also have the ability to format dates and the option of rendering this as a div or an input. With a style formatting you’ll have a perfect header for your report or section in your form.
The result:
I’ve look for something like this for a while now, and this is perfect. It does exactly what I want when displaying dynamic labels.



Written by Herman Geldenhuys
Leave a comment