| This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal. |
| This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal. |
Quick reply would be really helpful.
The easiest way to quickly store a global variable is to use Kony's built-in global varible functionality.
If you have multiple global variables and other constants you want to define in your application, I would suggest creating a a new js module to store them in. Create a new java script module under "Modules" in the project explorer and call it "Constants.js". You can call it anything you want, but if you end up setting other constants in your project you can store them here to. Attached is an example of one of mine:
I think you did not understood my question properly. What I wanted is to declare a variable globally and use it to store the form name from where ever it is called. Thanks for the previous answer but would need some more help on the same.
The Global variable functionality built into Visualizer allows to declare the variable and read and write to it whenever you want. As part of your code to call a form just write the name to the variable too. If I am still not understanding your question, please provide additional details and I will try to help.
Ok let me brief you properly with my difficulties. Suppose I have made a form and I want to use that form name dynamically in the modules of kony in javascript by storing the the form name in a global variable which I have defined with an empty string. So I just need a way to store a form name on an event in a global variable. Is there any way to do that?
Once you have your global variables as I have described above, you can simply read or write to it anytime just like any other variable. Examples varFormName = "LoginForm"
Thanks again for your answer.
I think, maybe, you're referring to form object, not name. The form's name/id is just a string. If you want to access the form's data or widgets etc, you need a handle to the form object. You can store the form handle itself and use it ala var frmRef = FrmHome; , but it'd be a lot of data if the form's heavy.