Members
(readonly, nullable) configuration :JSON
The authored configuration JSON. This can be used to parameterize a control. If there's no configuration authored, this will be null.
let { parameter } = oControlHost.configuration;
(readonly) container :HTMLElement
The container HTML element the control draws
itself into.
- HTMLElement
oControlHost.container.innerHTML = sHtml;
(readonly) control :CustomControl
The public control interface.
(readonly) isDestroyed :Boolean
The destroyed state of the control. true if the control has been destroyed and false if the control has not been destroyed. This is useful to check at the completion of an asynchronous operation to ensure that the control hasn't been destroyed before continuing.
- Boolean
(readonly) isVisible :Boolean
The visibility state of the control. true if the control is visible and false if the control is not visible.
- Boolean
loadingText :String
Sets the text displayed until the control's draw
method is called. This is useful if an asynchronous initialize
method is required.
- String
oControlHost.loadingText = "Loading...";
(readonly) locale :String
Get the locale.
- String
elButton.textContent = ( oControlHost.locale.indexOf( "de" ) == 0 ) ? "Anwenden" : "Apply";
(readonly) page :Page
The page containing the control.
const oControl = oControlHost.page.getControlByName( "Control1" );
Methods
back()
Go back one prompt page.
NOTE:
This function is not supported in a saved output report. SeeApplication#isSavedOutput
cancel()
Cancel report execution.
NOTE:
This function is not supported in a saved output report. SeeApplication#isSavedOutput
finish()
Submit parameter values and skip all remaining optional prompts and prompt pages.
NOTE:
This function is not supported in a saved output report. SeeApplication#isSavedOutput
generateUniqueID()
Generate a unique HTML ID. This ID can be used to safely insert HTML requiring IDs during a draw
.
WARNING:
The generated ID's uniqueness is based on the current IDs in the document. Calling this function multiple times will generate the same ID if an element using the previously generated ID has not been inserted into the document.
- Since
class CustomControl
{
draw( oControlHost )
{
oControlHost.container.innerHTML = `<div id="${oControlHost.generateUniqueID()}"></div>`;
}
}
generateUniqueID( sBase )
{
const d = document;
let sID = v_sBase;
let i = 1;
while ( d.getElementById( sID ) )
{
sID = sBase + i++;
}
return sID;
}
getParameter(sParameter) → (nullable) {Array.<Parameter>|Array.<RangeParameter>}
Called to get the current value of a parameter. Useful for selecting the initial values of a custom control. If the parameter doesn't exist, null is returned.
Name | Type | Description |
---|---|---|
sParameter | String | The parameter name. |
A parameter.
- Type:
- Array.<Parameter> |
Array.<RangeParameter>
next()
Submit parameter values and go to the next prompt page.
NOTE:
This function is not supported in a saved output report. SeeApplication#isSavedOutput
refresh()
Refresh the report
- Since
reprompt()
If the report contains prompt pages, the first prompt page is displayed. Otherwise, if the report doesn't contain prompt pages, this will re-prompt for values.
NOTE:
This function is not supported in a saved output report. SeeApplication#isSavedOutput
run()
Run the report
- Since
validStateChanged()
Called to notify the ControlHost that the valid state of the control has changed.
valueChanged()
Called to notify the ControlHost that a value has change.
class CustomControl
{
...
onSelectChange( oControlHost )
{
oControlHost.valueChanged();
}
}