View Full Version : What is the best way to read button (or other control) properties in a free-form container?


05-12-2016, 11:35 AM
I have two buttons (hidden, of course) wrapped in a free-form container which don't seem to expose their properties in the same way as embedded controls do.

The wrapping appears to modify the hierarchy, but I don't know how to drill-down and get information about the control other than its HTML content.

Each button in the free-form container has its click-event configured to run a JavaScript action, passing its "this" reference to the action. The button text is different from the label, and I want to use the label to store a command character in the label to set the function parameters.

So far, I have only been able to get the JavaScript action to read the "innerText" from the returned object:

var kTxt = this['innerText'];

if (kTxt == "C\nL\nE\nA\nR\n") {

kTxt = "";
tbTxt = "";


var tbTxt = {dialog.Object}.getValue("txtBx_OSK");
tbTxt = tbTxt + kTxt;

txt_lu = tbTxt;

This is the snippet I have been experimenting with to try to get the other properties from the button, and right or wrong, this works for reading the button text. But as you can see above, without being able to read an independent "command character" from the button, I am having to base branching instructions on the button text alone which is not going to work once the keyboard is fully expanded.

I would also like to read the state of the button's visibility so I can adjust the height of the button below it when it is hidden.

Now I'm wondering if I should be referencing the container instead of the button, since the container appears to have the formerly visible buttons "virtualized" as "aliased" objects (I assumed this from examining the Xbasic window), but I don't know how to traverse the tree.

It's probably very simple, and I'm certain it complies with common JavaScript syntax, but I can't find any relevant examples since the "free-form containers" are extremely new, so they do not have any comprehensive details entered into documentation.