2190
Views
5
Comments
Solved
How to add line breaks to an error/info/warning message
Question

Hi all,


I have been trying to add line breaks to error/info/warning messages with no joy. I have tried NewLine(), <br> and <br/> but none of them have worked.


Any suggestions?


Thanks!

2023-10-06 11-44-47
Andre Valadares da Silva
Solution

Hi folks,

I know the question is kinda old, but since there still no answer marked as a solution I decided to share what I did to solve the problem for an application I'm working on.

Nowadays you have a client action available in OutSystemsUi that you can use instead of the Message client action.

- In your Service Studio, select the "Manage Dependencies" icon
- In the Manage Dependencies window select OutSystemsUI on the left collumn
- On the right collumn look for the "FeedBackMessageShow" client action and select it:


 


Now in your client action you can use this action instead of the "Message" action.

Just mark the "Encoded HTML" attribute as "False" and there you have it. You can now use html tags to format your text (eg. <br> for line breaks).

Note that this action has the exact same functionality as the Message action, but here you have more control on the behaviour (eg. use the "Message Type" attribute to set the message to success, info, warning and error (0, 1, 2 or 3). You can even apply diferent style classes to change the message apearence.

Hope it helps anyone who needs it.

Best regards

2022-11-02 07-18-33
Nicholas Campbell

Thanks for taking the time to document this solution.

2022-04-26 21-27-03
Matt Geiger
2021-08-12 11-00-27
Nordin Ahdi
 
MVP

Hi Nicholas,

Try the solution provided in this post

It should works the same for Reactive Web Apps.

Regards,

Nordin

2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello there Nicholas,

Hope you're doing well.


Please consider to use this component: https://www.outsystems.com/forge/component-overview/9691/feedback-message-utils-reactive


Behind the scenes, it implements JavaScript Feedback Message API.


The action ShowFeedbackMessageCustom allows you to control if you want to escape HTML characters or not.

Just use it with the EncodeHTML input parameter as False.

You should use <br/> code to add a new line :)


Hope that this helps you!


Kind regards,

Rui Barradas

2023-10-06 11-44-47
Andre Valadares da Silva
Solution

Hi folks,

I know the question is kinda old, but since there still no answer marked as a solution I decided to share what I did to solve the problem for an application I'm working on.

Nowadays you have a client action available in OutSystemsUi that you can use instead of the Message client action.

- In your Service Studio, select the "Manage Dependencies" icon
- In the Manage Dependencies window select OutSystemsUI on the left collumn
- On the right collumn look for the "FeedBackMessageShow" client action and select it:


 


Now in your client action you can use this action instead of the "Message" action.

Just mark the "Encoded HTML" attribute as "False" and there you have it. You can now use html tags to format your text (eg. <br> for line breaks).

Note that this action has the exact same functionality as the Message action, but here you have more control on the behaviour (eg. use the "Message Type" attribute to set the message to success, info, warning and error (0, 1, 2 or 3). You can even apply diferent style classes to change the message apearence.

Hope it helps anyone who needs it.

Best regards

2022-11-02 07-18-33
Nicholas Campbell

Thanks for taking the time to document this solution.

2022-04-26 21-27-03
Matt Geiger
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.