Calling Feedback Message From Javascript

  
Hi,

How do I call Feedback Message from my script? I would like to use a feedback message in Outsystems instead of an alert box to be consistent and to have Outsystems uniformity.

ie:

Instead of doing:

alert("Hello World");

I would do it something like this instead:

osjs.feedbackMessage("Hello World");




Thanks,
Gino
Hi Gino,

I think there's no official supported way of using the OsNotifyWidget by javascript (to send a feedback message), meaning that we can at anytime change its usage and behavior and consequently break your application.

regards,
HD


Hi!

I think you can use the fake notify widget from RichWidgets to send your message throught the notify (see the widget description to learn how to use), and on the FakeOnNotify screen action, get your message with the NotifyWidgetGetMessage and display the feedback.

@Hélio:
 If there's no official supported way of using the OsNotifyWidget by javascript, is it safe to use the fake notify widget? 
 
Solution
Hi Gino,

Just published a component to do that, using the approach mentioned by Bruno.
Here is the link http://www.outsystems.com/forge/component/590/feedbackjs/

It uses the FakeNotifyWidget, it it does one extra server round-trip for that.

To Bruno, well It's safer than just using it directly a Notify to the Feedback block. If in the future the OsNotify is broken at least the FakeNotifyWidget will have to include an upgrade or compatibility path to keep things working.


Regards,
João Rosado
Solution
Hi Bruno,

Yes it is safe to send a message through the OsNotifyWidget by javascript. This might be the best solution for this issue, because you are calling an action on the module.

@Gino take a look on João Rosado component :) it has all you need

I've changed the previous message to enforce that it is not supported to send a feedback message directly (which is the issue here) without calling an action on the server. But it is possible... but it isn't a very pretty solution. I do not recomend it.

You would have to pass the feedback widget id and the message Type Id concatenated in the message...


.. and btw thanks João. :)

Thanks guys appreciate it :)
Hi Gino,

Someone just noticed that my component had the wrong eSpace uploaded.
Just fixed it, so if you downloaded already please download the new version.

Regards,
João Rosado