Other OutSystems sites...
OutSystems Website
About Agility Blog
OutSystems Network
Login
Signup
Forums
Academy
Forge
Ideas
Forums
›
Technology & Integration
›
Refreshing EditRecord does not trigger jQuery document ready function
Refreshing EditRecord does not trigger jQuery document ready function
Joop Stringer
Rank: #16
Posted on 2012-07-03
thumbs_up_ico
0
thumbs_down_ico
0
reply
post_link_ico
Hmmmm anybody noticed this already ?
I've got an edit record where, with help of piece of jQeury, only allow numeric input in some fields (telephone/fax)
When I do an AJAX refresh, the document ready function is not triggered and so the piece of code is not executed .... and they can fill in letters and numbers again ....
The jQuery piece is in the layout_normal because there are more global settings there
Any idea how to solve this ?
João Rosado
Rank: #35
Posted on 2012-07-04
thumbs_up_ico
0
thumbs_down_ico
0
reply
post_link_ico
Hi Joop,
You need to put the call of your javascript inside the part you are refreshing if you want it to run again.
jQuery.Ready is a not like other binds ...it cant even be triggered manually.
Edit: Another option is calling the RunJavascript method after the ajax refresh. It has the exact same effect.
Regards,
João Rosado
Joop Stringer
Rank: #16
Posted on 2012-07-04
thumbs_up_ico
0
thumbs_down_ico
0
reply
post_link_ico
João,
Found out that refreshing only certain inputwidgets works perfect instead of refreshing the whole edit record...
But can you explain the RunJavaScript part please .... ?
João Rosado
Rank: #35
Posted on 2012-07-04
thumbs_up_ico
0
thumbs_down_ico
0
reply
post_link_ico
Hi Joop,
Its a method in the HttpRequestHandler.
It sends a piece of javascript to be executed in the browser. Also it respect the order of ajax operations in the flow:
For example: If it's used in the flow after an ajax refresh then it runs after the widgets are rendered.
It has the exact same behavior as having an unescaped javascript expression in the page with and doing an ajax refresh of the expression. ...but it's alot cleaner.
Regards,
João Rosado
Quick Reply
Notify me by email when someone answers to my post
attachment
Choose File
No file chosen
Submit
Login to reply
Something on your mind?
Login to Start a Discussion
Top Forums Posters
Gonçalo Martins
Davide Marquês
Ricardo Silva
Richard Pearson
Statler & Waldorf
Charles Colaço
Fábio Silva
Justin James
Robert Chanphakeo
Kilian Hekhuis
See leaderboard
Online Training
On-demand video lessons to help you learn at your own pace.
Learn More