Arjan van IJzendoorn on June 3, 2015
We just released Mendix 5.16 and you can find the long list of improvements in the release notes. Today I want to highlight one of the new features: glyphicons. These icons are the modern take on images on buttons.
Glyphicons have a number of advantages over bitmap icons. They are actually characters in a special font that comes with Bootstrap, the CSS framework we use. As such, they share several properties with the label of a button:
There is another advantage in terms of performance. The icon font is already loaded by our web client and available for you to use. Bitmap icons result in extra requests to the server, but glyphicons do not. Especially on mobile, every reduction in the number of request counts.
In the Business Modeler, the property ‘Image’ of buttons has been renamed to ‘Icon’ and editing this property will give you the following selector.
There are more than two hundred glyphs available, so we offer the option of filtering based on their name. And of course, you can still use the bitmap icons through the ‘image’ option.
This is all well and good for when you create a new project, but what if you already have a project with hundreds of pages full of buttons? That is where the new batch icon update comes in. You can find it in the Tools menu and it allows you to quickly change the icons of thousands of buttons. There are two ways of filtering that can be combined:
Finally, you can choose what icon to give to the filtered set of buttons. By choosing ‘none’ you can clear the icons of those buttons. Note that there is no undo available for this project-wide operation, so we recommend using version control to make sure that you can undo unwanted changes.
By default, the Modeler no longer puts icons on buttons. Many developers have told us that the first thing they do is to remove them so we decided to save them a step.
In Mendix 5.16 we upgraded the Bootstrap framework to 3.3.2 so that you have more icons to play with. Judging from our Forum, people have already been using CSS workarounds to display glyphicons on their buttons, but now you can start using the new icons and actually see what you are doing in the Modeler. Finally, we want to thank the fine people at Glyphicons.com for making their Halflings icons freely available to Bootstrap users.
Receive Mendix platform tips, tricks, and other resources straight to your inbox every two weeks.