2039
Views
25
Comments
Solved
Auto closing feedback messages on Mobile Devices

Is there a way to automatically close feedback messages on mobile devices without requiring the user to click on the message?  We would like the message to be cleared either after a set number of seconds or when a new screen is opened.

Thanks

Dan Asserati

2017-07-05 22-17-18
Henrique Batista
Staff
Solution

Hi Erwin,

By looking at your code, you're closing it immediately. Try the following:

setTimeout(function(){ 

  $public.FeedbackMessage.closeFeedbackMessage(); }, 

2000);

Hope it helps

2016-11-20 11-27-52
João Neves

Hi Daniel,

Is this a mobile or web-responsive module?

UserImage.jpg
Daniel Asserati

The issue holds for both but in this case its a v10 mobile module.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

This would indeed be helpful. I've had a scenerio where the user can't advance to the next screen because of faulty input, but after correcting the input and advancing to the next screen, the error is still there...

2016-11-20 11-27-52
João Neves

Let me introduce you to the following new feature:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/FeedbackMessage

Hope this helps.

Btw, info and success messages are automatically closed after a few seconds.

UserImage.jpg
Daniel Asserati

Thanks Joao this API is very interesting.  To implement this to close any open popups after login would I drop a Javascript node into the action with the code "$public.FeedbackMessage.closeFeedbackMessage()"?

Thanks

Dan

2016-11-20 11-27-52
João Neves

Yes.

UserImage.jpg
Daniel Asserati

When trying to use the above in a javascript node I get the following error message on compiling: 

"Public JS API Not Supported
This module uses unsupported Javascript APIs. Using these APIs via $public is not supported in this version.
Exception Details:
[1] Public JS API Not Supported: This module uses unsupported Javascript APIs. Using these APIs via $public is not supported in this version..."

Any thoughts on why my implementation is causing this error?

2016-11-20 11-27-52
João Neves

This API is only available on 10.0.200 or above.

UserImage.jpg
Daniel Asserati

Is there any known way on versions before 10.0.200?  We are unlikely to be moving to this version or higher for a while.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Daniel Asserati wrote:

Is there any known way on versions before 10.0.200?  We are unlikely to be moving to this version or higher for a while.

Daniel,

Since P10 is pretty new, there are bound to be quite a number of issues fixed in the coming releases (especially on mobile). So even if you're not going to 10.0.200, I would advise you to consider upgrading regularly.


2016-11-20 11-27-52
João Neves

Sorry to know that but no, this was only made available in 200.

2016-08-12 19-14-19
Bruce Buttles

I am on v10.0.201 ... but, I can't find the new FeedbackMessage.

Right now, I am using the RichWidget.Feedback_Message method to display messages to users.

I am building a responsive web app for desktop, table, and phone. 

Is the new FeedbackMessage only available to pure MOBILE apps?

2016-11-20 11-27-52
João Neves

Bruce,

This new Feedback Message is applicable to Mobile Apps only.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Yeah, and it works like a charm. I put a close in the header, so after each screen transition any message is removed.

2014-12-24 13-44-21
Keith Matthews

Hi Kilian,

Could you show me exactly how you did that?

Thanks

Keith




2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Keith,

What I did exactly is:

1) Create a Client Action named "FeedbackMessageClose", with the following logic:

2) In the Header Web Block, that's included in every screen, I added an OnReady handler:

3) In the OnReady Action, I added a call to the FeedbackMessageClose Action:

Of course, you can also directly call the JavaScript from the OnReady, but you asked how I did it exactly, so... :)


2014-12-24 13-44-21
Keith Matthews

Kilian Hekhuis wrote:

Perfect. Thanks 

Hi Keith,

What I did exactly is:

1) Create a Client Action named "FeedbackMessageClose", with the following logic:

2) In the Header Web Block, that's included in every screen, I added an OnReady handler:

3) In the OnReady Action, I added a call to the FeedbackMessageClose Action:

Of course, you can also directly call the JavaScript from the OnReady, but you asked how I did it exactly, so... :)




2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You're most welcome :).

2018-06-14 05-49-12
Erwin van Dis

Anybody know how to close the feedback message after a specific time? I tried:

setTimeout($public.FeedbackMessage.closeFeedbackMessage(),2000);

But unfortunately this closed the feedback message directly.

With kind regards,
Erwin


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Erwin,

I'm not sure whether that's possible. I'm also not sure what you tried in that JavaScript, as you call closeFeedbackMessage(), which indeed closes the feedback message :).

2017-07-05 22-17-18
Henrique Batista
Staff
Solution

Hi Erwin,

By looking at your code, you're closing it immediately. Try the following:

setTimeout(function(){ 

  $public.FeedbackMessage.closeFeedbackMessage(); }, 

2000);

Hope it helps

2018-06-14 05-49-12
Erwin van Dis

Works fine Henrique!

Thx for your reply and solution!

UserImage.jpg
elson godinho
UserImage.jpg
Mercy A

Hi I am using 'Info' widget to display my message with error type. This following  java script is not working.

setTimeout(function(){ 

  $public.FeedbackMessage.closeFeedbackMessage(); }, 

2000);


This is working only for 'Run Server Action' feedback message. Can anyone please help me out

2018-11-30 08-20-55
Hendra

Hi,

I found another solution to add auto hide into warning/error feedback for reactive/mobile.

To make warning/error feedback message have similar behavior like info/success feedback message (eg: auto hide), just add class into warning feedback message. this class called  "feedback-message-autoclose". this class used in info/success feedback for auto hide.

I've create a tutorial to manually add that class to feedback message in this link


Cheers.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.