Our goal? Making
complex simple

25 May 2016

Great feedback-notifications in your app (install in 58 sec!)

Pim van der Noll
Chief Technology Officer

In Mendix you can use the standard messages to confirm that the data is saved or something went wrong. These messages are very in-your-face and you have to confirm that’s “OK” 😕 It’s more user friendly to use a standard widget for notifications. Mendix has a widget that can show a nice notification (Mx Appstore) based on Noty.

The challenge

The challenge is that you don’t want that widget on every page. So you can use the widget in a page layout. But.. just placing the widget in a page layout will not refresh after close page etc. and won’t show the nice notification. This is by design since Mendix >5.13 has some advantages for your navigation menu state etc (so your current menu item is still highlighted).

So I searched and asked the Mx forum (https://mxforum.mendix.com/questions/8480/refresh-dataview-snippet-in-layout) and tried some tricks to force a refresh after saving and object, but it didn’t work out. Finally, we found a solution without JavaScript hacks but only with the use of a standard templategrid in the pagelayout and a standard java-action for the refreshing command from the community commons module.

Easy to use in your app in just 58 seconds   (just to mention how quick :))

2. Place the NoticationSnippet in your pagelayout
3. Adjust your User Roles a give all users access to the module role User
4. Place the sub-microflow SF_CreateNotification_Default in your own save/commit microflows and provide the parameters: Message and Type (info, error, success..)

5. It will show a nice notification

See installation below (click on the 58 sec video below):

 

Adjust type of message, timing, layout

Use SF_CreateNotification instead of SF_CreateNotification_Default and provide more parameters:

  • Layout  (Enum_Layout, default topCenter): location of the message; top, topLeft, topCenter, topRight, center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, bottomRight.
  • Timeout (2000 milliseconds default) and 0 if you want the message disappear on click

The result

A really nice notification anywhere in your screen you want. Trigger can be in any microflow.

Do you have any comments, questions, feedback or suggestions? Please let us know! Get started a give your users a ‘popup-message-free’ app: Download here!