2017 June Release

Control OptionsPermanent link for this heading

Control options are evaluated in the controloptions expression, which is defined in the app.ducx user interface language in the corresponding property block.

Syntax

app.ducx User Interface Language

...

layout {
  row {
    CustomControl property {
      controloptions = expression {
        ...
      }
    }
  }
}

The result value has to be in JSON format. The control options can be accessed in the client JavaScript using the GetOptions() function.

Example

app.ducx User Interface Language

...

layout {
  row {
    CustomIntegerControl ctrlsampleinteger {
      colspan = 4;
      labelposition = left;

      // the values are available in the client JavaScript
      controloptions = expression {
        dictionary @options = {
          optstyle: 'h2',
          num: 42
        };
        return coouser.Value2JSON(@options);
      }
    }
  }
}

render.js

this.OnRender = function CustomObjectListControl_OnRender(output)
{

  // retrieve the control options
  var options = this.GetOptions();
  // print the defined options
  output.Push("<" + options.optstyle + ">" + options.num + "</" + options.optstyle + ">");
}

Note: Values of control arguments override values of control options with the same name. It is highly recommended to avoid this situation.