969
Views
8
Comments
Solved
in Action Flows, in a Screen Action or a Server Action, can't see/use RunJavaScript
Question

After enabling following dependency, in Action Flows, either in a Screen Action or a Server Action, can't use RunJavaScript action of the HTTPRequestHandler extension. What do i miss?

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

Giorgos Sgouridis wrote:

From where exactly i have to drag and drop it, I can't understand it from your screenshot.
I dont see it on the sidebar of my client action afterenabling it on the dependency manager.

Hello Giorgos,

Hope you're doing well.

RunJavaScript is a server action from HTTPRequestHandler extension.

The purpose of this action is to send the defined JavaScript code to run in the context of the browser. This means that the code will run on the client side, not on the server side (although we're talking about a server action).

In order to use it in your flows, you should enable the dependency (like you did), you can just drag and drop it from your Logic tab to your flows or you can drag the Run Server Action widget (from your left panel) and choose RunJavaScript action.


However, let me just say that this RunJavaScript server action applies only to Traditional Web Applications.

From what I can see, you're working on a Mobile or Reactive Web Application.


In Reactive Web and Mobile Applications, you have the JavaScript widget instead (which you are already using it) in order to run your JavaScript code on the client side:


Kind regards,

Rui Barradas

2023-03-09 07-10-59
Vipasha Sharma

Hi Giorgos,

After enabling the "RunJavaScript" from manager dependency drag and drop it into the screen action or server action when you want to run your java script, please refer the below attachment.

Hope this will help you.

Regards,

Vipasha

UserImage.jpg
Giorgos Sgouridis

I AM ON MOBILE.
From where exactly i have to drag and drop it, I can't understand it from your screenshot.
I dont see it on the toolbox of my client action afterenabling it on the dependency manager.

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

Giorgos Sgouridis wrote:

From where exactly i have to drag and drop it, I can't understand it from your screenshot.
I dont see it on the sidebar of my client action afterenabling it on the dependency manager.

Hello Giorgos,

Hope you're doing well.

RunJavaScript is a server action from HTTPRequestHandler extension.

The purpose of this action is to send the defined JavaScript code to run in the context of the browser. This means that the code will run on the client side, not on the server side (although we're talking about a server action).

In order to use it in your flows, you should enable the dependency (like you did), you can just drag and drop it from your Logic tab to your flows or you can drag the Run Server Action widget (from your left panel) and choose RunJavaScript action.


However, let me just say that this RunJavaScript server action applies only to Traditional Web Applications.

From what I can see, you're working on a Mobile or Reactive Web Application.


In Reactive Web and Mobile Applications, you have the JavaScript widget instead (which you are already using it) in order to run your JavaScript code on the client side:


Kind regards,

Rui Barradas

UserImage.jpg
Giorgos Sgouridis

Thanks a lot Rui for the detailed information. Indeed i am on mobile. I used the following snippet to change a button from disabled to enabled. What i am missing as its not applying the change on the button? "document.getElementById('" + HasItemButton.Id + "').disabled = false;"

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

Hi again Giorgos,

The syntax seems to be correct.

Are you passing the correct Id of the button?

Kind regards,

Rui Barradas

UserImage.jpg
Giorgos Sgouridis

Hi Rui Barradas, thanks for posting back.
I am attaching you the oml. I am greatful if you can help me move forward with this issue.
Tks a lot.

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

You're most welcome Giorgos.

You didn't attach the OML, maybe you missed it.

Send me a private message and I will try to help you with your issue, if you still need help on this matter.


Kind regards,

Rui Barradas

UserImage.jpg
Giorgos Sgouridis

Thanks again Rui i managed to resolve it.
Attached the solution in OML. I don't know if there is a better workaround.

In case you have time available i would appreciate if you could help me on this one
https://www.outsystems.com/forums/discussion/63878/populate-local-storage-with-static-records-and-logic-to-add-dynamically-new-value

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