Javascript functions and UI Objects


John Clarke
In the Show event of my view I have the following code In this view I also make use of a function that is stored within an eternal JS file.

How can I get the function in the external JS file to update the value in views.headerHTML.automationcode.value ?


DecSoft

Hello John,

I think you have two possibilities, well,... three... if you count to place the function in the Show event, or the app DomReady event. You can also place the function as an app's function, using the app's Functions Manager, then you can use the function's body that you show "as is". And you can also place the function in an external JavaScript file, however, in this case you must use the function's return / result, that is, your code must be something like this:

There is another additionally possibility, John, using some app's internal methods like "app._getCurrentView()", since we have a "window.app" variable that we can use, however, probably the possibilities mentioned above are more recommended. For example, just use the external JavaScript function's return / result can be enough, so we no need to deal with app's internal methods, which maybe can change in the future, etc.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.