327
Views
11
Comments
Solved
How to incorporate JavaScript in a screen
Application Type
Mobile

Hi,

I am trying to add a timer in my screen and i have zero experience in JavaScript.

With some google search, i was able to find a javascript that gets the job done.

But i dont know how to add this javascript into my page and get a variable to update the starting point of my timer.

Could someone please help me with this please.

Attached the javascript i found below

Timer.js
2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi,

I'm not sure what exactly your use-case is, but I have tried to create a sample app using the JavaScript shared in the main post.

See this sample app | TimerJSDemo 

Please refer to the attached .oml file


Hope this helps you or at least give you a direction for the final solution.


Kind regards,

Benjith Sam

MobileLabTimerJS.oml
UserImage.jpg
Learn It

This is it. Thanks Benjith for the oml.

I was trying to find the command to pass the output to a container Id and then you send me the complete code. Really appreciate your help.

Thanks

2021-03-18 21-03-15
Benjith Sam
 
MVP

Your are welcome.

Glad to help you :)


Kind regards,

Benjith Sam

2020-09-21 11-35-56
Sachin Waghmare

Hi Learn It,

Please refer the below link to get the idea about how to use Java script.

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/JavaScript/Extend_Your_Mobile_and_Reactive_Apps_Using_JavaScript

Thanks & Kind Regards,

Sachin

UserImage.jpg
Learn It

Thanks Sachin. This looks to be a good document to start.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

Why don't you make your life more easy and use a Forge component that already encapsulated the Javascript for your?

https://www.outsystems.com/forge/component-overview/2539/javascript-timing-events

Regards,

Daniel

UserImage.jpg
Learn It

I just tried it and for some reason it is not working. When i click on clear interval, nothing is happening.

Even i tried to download some other timer components, but i am getting error with the OutSystems UI version compatibility.

Thanks why i went out for a Javascript.

Appreciate if you can give me some tips on how to use the script i attached .

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

I've justed them more than once without problem.

What didn't work? Did you get an error message?

UserImage.jpg
Learn It

The moment i click on clear interval, the Counter just stucks and doesnt do anything. i have go refresh the page to restart the counter again



UserImage.jpg
Learn It

On Top of this, i am getting error while trying to download this application from forge

Is it safe to forceinstall this tool? as i dont want to messup my applications

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

This component just encapsulates plain javascript in OutSystems actions and blocks.

The reason you get the warning is becuase it was published under version 10 of OutSystems.
Hence the warning: JavaScript Timing Events may be incompatible with your platform version.

It is safe to install in your environment.

I will ask the component owner if it can be republished for version 11.


2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi,

I'm not sure what exactly your use-case is, but I have tried to create a sample app using the JavaScript shared in the main post.

See this sample app | TimerJSDemo 

Please refer to the attached .oml file


Hope this helps you or at least give you a direction for the final solution.


Kind regards,

Benjith Sam

MobileLabTimerJS.oml
UserImage.jpg
Learn It

This is it. Thanks Benjith for the oml.

I was trying to find the command to pass the output to a container Id and then you send me the complete code. Really appreciate your help.

Thanks

2021-03-18 21-03-15
Benjith Sam
 
MVP

Your are welcome.

Glad to help you :)


Kind regards,

Benjith Sam

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