Posts: 107
Threads: 33
Joined: Jun 2019
Reputation:
0
Location: Canada
05-04-2023, 10:50 PM
(This post was last modified: 05-04-2023, 10:51 PM by valmeras.)
I am using Intraweb 15.3.3 with Rad Studio 10.2.3 (C++ Builder).
It seems to me that when a template is loaded on IWForm the IWAppFormRender event is triggered before the template complete to load.
Which is a problem!
Because I have some JavaScript code in the template which return values needed by the IWAppFormRender event!
Is is the right event order?
Posts: 2,301
Threads: 204
Joined: Mar 2018
Reputation:
87
Location: Auckland, New Zealand
05-06-2023, 05:28 AM
(This post was last modified: 05-06-2023, 09:56 PM by Alexandre Machado.)
The OnRender event is a server side event, not a client (browser) side one. It will always happen when (i.e. immediately before) the HTML is being generated on the server side. Is it not the right place to use this kind of functionality that you want.
What you want here is a kind of chicken & egg problem. JavaScript will only run on browser side after rendering but you want to get the return values of JS functions before rendering which is not possible.
If your form needs some browser information other than the size of the window, you need to obtain this when your application starts and then adjust the rendering of the forms according to it.