Feedback Message Triggering a Screen Action

I'm working with Reactive Web for Outsystems 11.

I want to be able to click on a warning feedback message and trigger a screen action.


What I did so far:

  1. I have a hidden link that is hidden with (style="display: none;") named Update_Button.
  2. An OnAfterValidateVersion client action that triggers the warning message followed up by a Javascript widget that executes this code:  

var warningmessage = document.getElementsByClassName("feedback-message feedback-message-warning")[0];
var button = document.getElementById("Update_Button.Id");
document.addEventListener("DOMContentLoaded", function () {
    warningmessage.onclick = button.click();
});


I also got the same results with this:


var warningmessage = document.getElementsByClassName("feedback-message feedback-message-warning")[0];
document.addEventListener("DOMContentLoaded", function () {
    warningmessage.onclick =  $('#" + Update_Button.Id + "').click();
});


The problem I'm facing is when I click the warning feedback message nothing happens. What am I doing wrong? 

Thanks for your time.

Solution

Hi Luis,

I have created a sample app based on your requirement, hope this helps you!

See the sample app

Refer this:  JavaScript_API/FeedbackMessage


Please find the attached .oml solution file.


Regards,

Benjith Sam

Solution

Benjith Sam wrote:

Hi Luis,

I have created a sample app based on your requirement, hope this helps you!

See the sample app

Refer this:  JavaScript_API/FeedbackMessage


Please find the attached .oml solution file.


Regards,

Benjith Sam

Hi Benjith Sam,

I'm really grateful it's exactly this what I were looking for! The link you posted also helps immensely.

Thanks again for your support.


Luis Martins wrote:

Hi Benjith Sam,

I'm really grateful it's exactly this what I were looking for! The link you posted also helps immensely.

Thanks again for your support.

You are welcome, Luis :)

I'm happy and glad that the solution helped you :)


Regards,

Benjith Sam