Lua Dialog Control Field Updates

This section is for general discussion about Gadgets
Post Reply
DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Lua Dialog Control Field Updates

Post by DVE2000 »

I know I can update a Label field, for example, with a dialog:UpdateLabelField() call, but I can't figure out a way to update a Button label. There are SetInnerHtml() and SetOuterHtml() functions, but they don't seem to do anything. There are no examples, and the descriptions in the Interface Document aren't helpful.

I'd also like to disable or enable a TextField, but there doesn't seem to be a way to do that either. Again, I tried the SetInnerHtml() and SetOuterHtml() functions to no avail.

Does anyone have an idea of how to do either of these two things? I played a bit with a JavaScript function and using onchange=MyFunc() in a label field, but it's not called when the label is updated. MyFunc() looks like this:

Code: Select all

<script>
function myFunction() {
  var x = document.getElementById("ButtonApply");
  x.value = "Apply";
  x.disabled = true;
}
</script>

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Lua Dialog Control Field Updates

Post by DVE2000 »

onchange does work with the user manually changing a text box and moving the focus, but not when UpdateDoubleField() is called for the selfsame text box.

DVE2000
Posts: 24
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Lua Dialog Control Field Updates

Post by DVE2000 »

I figured out a kludge by using a javaScript setTimeout(func, 1) to call the function. A text field is set by the lua script for a non-visible textbox, and the function can decode the value to set up the initial dialog display.

I'm still curious about the SetInnerHtml and SetOuterHtml functions though.

Post Reply