Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using variables in index.gui files

ANSWERED

I must be missing something, but I can't figure out how to display a string variable in the index.gui file.

Any help would be appreciated.

Best Answer
1 BEST ANSWER

Accepted Solutions

Unfortunately, there is no data-binding mechanism here. You need to get the UI element in your app/index.js by calling

 

let element = getElementById("YOU_UI_ELEMENT_ID")

 

and then set the text on the UI element object.

 

element.text = "YOUR_TEXT";

View best answer in original post

Best Answer
0 Votes
4 REPLIES 4

You can't. You have to use javascript to maniplate the appropriate index.gui element.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Unfortunately, there is no data-binding mechanism here. You need to get the UI element in your app/index.js by calling

 

let element = getElementById("YOU_UI_ELEMENT_ID")

 

and then set the text on the UI element object.

 

element.text = "YOUR_TEXT";

Best Answer
0 Votes

How do I get the ui element id and where do I put the variable? Would it be

element.text = var test; 

or not?

Sry for asking stupid questions 😉

Best Answer
0 Votes

Have a look at the example code here.

Peter McLennan
Gondwana Software
Best Answer