Tom Nogueira wrote:
Hello Rui!
Thanks for response:)
I am in Tradicional Web, is the same process ?
Thanks again.
Hello Tom,
For Traditional Web Applications, it is very different :)
In this scenario, you will need to put your JavaScript code in the Preparation of your screen, using RunJavaScript action (from HTTPRequestHandler extension). Also, you need to use FakeNotifyWidget Block from RichWidgets module directly in your screen.
Your script should incluse this function:
"OsNotifyWidget('"+ <YourFakeNotifyWidget>.Id +"', '<Message>')"
Please consider this post from MVP Nordin Ahdi where he provides an excellent explanation about this topic and how it should be implemented.
Also, I did a sample for you and your JavaScript code should be something like:
"
$(document).ready(function() {
$(window).on('keydown', function(event) {
if (event.keyCode === 49 || event.keyCode === 97) {
OsNotifyWidget('"+ MyFakeNotifyWidget.Id +"', 'key1');
}
if (event.keyCode === 50 || event.keyCode === 98) {
OsNotifyWidget('"+ MyFakeNotifyWidget.Id +"', 'key2');
}
if (event.keyCode === 51 || event.keyCode === 99) {
OsNotifyWidget('"+ MyFakeNotifyWidget.Id +"', 'key3');
}
if (event.keyCode === 52 || event.keyCode === 100) {
OsNotifyWidget('"+ MyFakeNotifyWidget.Id +"', 'key4');
}
if (event.keyCode === 53 || event.keyCode === 101) {
OsNotifyWidget('"+ MyFakeNotifyWidget.Id +"', 'key5');
}
if (event.keyCode === 54 || event.keyCode === 102) {
OsNotifyWidget('"+ MyFakeNotifyWidget.Id +"', 'key6');
}
});
});"
Please refer to attached OML file with an example for Traditional Web of a client action beeing triggered by clicking in your keys (from 1 to 6).
Hope it helps you!
Kind regards,
Rui Barradas