I have an application page that uses a custom widget that receives a Javascript variable as one of its property elements.
The return of the variable javaScript occurs after processing API calls, several lines of code to confirm the response, returning a Json. When viewing the return via a text element on the page itself, I can see it perfectly. However, when defining this variable as the custom widget property, I get that the return of my JS variable is not defined, within the controller code I placed a console.log for the property and I get the "undefined".
I believe that when the custom widget code is executed, the result of this JS variable is not ready yet. How to define this order of execution? Is there any detail that I should look at more closely? Can this be caused by the structure of my custom widget itself?