I would like to offer an alternative. This is a tough problem, as these snackbars take a lot of logic to implement, using timers (after seconds), conditions (close page/click) etc. I have tried this many times using basic Mendix components, but the system is clunky and will result in a lot of maintenance. E.g. what if you close the page – should the timed-out logic still close your snackbar? Will it still even be there? What if you click the message? And should this be context dependent or independent? Using standard Mx components, this is virtually impossible to develop without having over-extensive maintenance, just of a simple snackbar.
And here is an example of the JsA in a Nanoflow, including the preferred parentClass (using this class will mean an auto-close of the snackbar upon page refresh, and a centrally-aligned snackbar on your page).
Hope this helps. If it did, please mark as correct ;-)
If you are saving your data using a microflow, you can use Show message activity.
Look the next example, on the CreatePostPage on the On Click option of the save button, I call a microflow that creates the Post object and sends it to an API.
Inside the activity I put the message:
And the result is:
Hope it helps.
Hi Preethi Paramesh,
You can call a pop up which display the Success Message at the end of your save microflow . There should be a close page before the pop up page so that you will be navigated to the Home page. In your Success Pop up page you can put a Microflow timer widget and Configure a microflow which has two activities – Delay Java Action (You can set how many seconds the pop up should be there ) and a close page( Which closes the Success popup Page) .
Note : Delay java action is part of the community commons Module from market place .
You can design your pop up like a toaster message using custom styling.
Hope this helps!!