Lua Dialog Control Field Updates

This section is for general discussion about Gadgets

Lua Dialog Control Field Updates

Postby DVE2000 » Wed Jun 26, 2019 8:58 pm

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: 20
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Lua Dialog Control Field Updates

Postby DVE2000 » Wed Jun 26, 2019 9:11 pm

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: 20
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster

Re: Lua Dialog Control Field Updates

Postby DVE2000 » Wed Jun 26, 2019 10:00 pm

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.
DVE2000
 
Posts: 20
Joined: Fri Aug 17, 2018 7:59 pm
Model of CNC Machine: CAMaster


Return to Gadgets - General

Who is online

Users browsing this forum: No registered users and 2 guests