Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Suraj Borade
1657
Views
7
Comments
Solved
Problem with RunJavaScript action
Question
JavaScript
Hello,
I am using RunJavaScript function to run JavaScript code.
I am using this function to click a hidden link but when call comes to this function, Javascript associated with that function doesn't work.
I have created hidden link and on properties pane have given property like this:
and then calling this link through RunJavaScript function.
As per the functionality, when RunJavaScript function called, this JavaScript code must be executed but it's not working.
Am I doing anything wrong?
Please advice.
Thanks and Regards,
Suraj Borade
João Rosado
Staff
Solution
Hi Suraj,
Is your Save button maked as "Submit" or "Ajax Submit" ?
It will only work on the ajax one.
Regards,
João Rosado
See solution in context
George Jeffcock
Hi Suraj,
What are you trying to achieve business wise?
What you are attempting to do architectually is frowned upon in my experience of web architecture. The server should not instigate physical events on the client. You can but it is not encouraged.
Why can you not intiate the save with logic server side?
RunJavascript will queue a script to be executed after the page is loaded in the client will mean your update action will be called first before the script runs is my guess
Regards, George
João Rosado
Staff
Hi Suraj,
Note that you are trying to click on the "Text" not on the "Link".
Regards,
João Rosado
1 reply
09 Jun 2016
Show thread
Hide thread
George Jeffcock
nice catch
João.
Suraj Borade
Hi Joao and George,
Thanks for your replies.
@Joao,
CSP team has demonstrated this technique to me in our CSP Session last week. OML which CSP team has sent to me is working fine when text inside link is named as "ClickToSave" and this link is also getting clicked when clicked through RunJavaScript function.
Only thing is that CSP team is calling this JavaScript function inside onchange event of ComboBox and I am trying to call this JavaScript function on Save button.
@George
Why can you not intiate the save with logic server side?
I have WebScreen and inside that I am using WebBlock. I want to initiate Save action inside Web Block when Save action from Web Screen is clicked and I am trying to achieve that by clicking on hidden link through JavaScript.
Note: This hidden link is inside WebBlock and Save action is associated with that link. So when JavaScript runs, it should click that link.
Please advice.
Thanks and Regards,
Suraj Borade
Suraj Borade
I have demonstrated this to CSP team yesterday and they are also thinking why this is not working in this case.
João Rosado
Staff
Solution
Hi Suraj,
Is your Save button maked as "Submit" or "Ajax Submit" ?
It will only work on the ajax one.
Regards,
João Rosado
Suraj Borade
Hi Joao,
It worked when I marked my Save link to "Ajax Submit".
Thanks and Regards,
Suraj Borade
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
 Loading...