Yes, it is possible, but not with one standard Button widget alone if you want the icon itself to change dynamically per gallery item.
In a Gallery, each row is rendered from the same template. So if you configure one Button with one icon, that same icon is reused for every item. The caption can come from data, but the icon property is not dynamically data-driven in the standard setup.
The usual Mendix way is:
That is the simplest and most maintainable approach.
If you really want to keep a single clickable element, another option is to show an Image dynamically from data and place it inside a container that acts like a button. But for normal Mendix pages, conditional visibility with multiple icons/buttons is usually the cleanest solution.
So in short:
Different captions from data = easy
Different icons from data = not directly supported on one standard button
Best practice = use multiple widgets with conditional visibility
If this resolves your issue, you can mark it as accepted.
Hi,
Yes, it is possible to display different icons for each item inside a Gallery. Since a Gallery repeats UI based on each object, the correct approach is to make the icon dynamic based on the object’s data.
IconType (String or Enumeration)"edit""delete""view""download""share"if $currentObject/IconType = 'edit' then 'fa fa-edit' else if $currentObject/IconType = 'delete' then 'fa fa-trash' else if $currentObject/IconType = 'view' then 'fa fa-eye' else ''
Make sure you are using a supported icon library (Atlas UI uses Font Awesome).
Example:
$currentObject/IconType = 'edit'$currentObject/IconType = 'delete'$currentObject), so your logic must depend on object data