Although the HTML Composer is fully integrated with JavaScript, it is suggested that you do not create custom JavaScript that manipulates the HTML Composer generated controls, as WebFOCUS cannot support such custom JavaScript code. Additionally, there is no guarantee that the JavaScript code will work correctly in future releases.
Note:
//End function window_onload
The HTML Composer run time will call onInitialUpdate() if it exists.
How to: |
The IbComposer_getCurrentSelection function gets the current selected values from a control.
IbComposer_getCurrentSelection('controlID', [layer]);
where:
Alphanumeric
Is the unique identifier of the control from which values are obtained.
Integer
Is an optional parameter used to specify the layer number in a multi source Tree control if a Multi source Tree control is being used. The layer number starts with 1 for the first layer.
function button1_onclick(ctrl) { var values = IbComposer_getCurrentSelection('combobox1'); for(var I = 0; i < values.length; i++) alert(values[i]); }
How to: |
The IbComposer_setCurrentSelection function sets the current selected values for control parameters.
IbComposer_setCurrentSelection('controlID', arrValues, bUpdateDependencies);
where:
Alphanumeric
Is the unique identifier of the control for which to set the values.
Array
Is the array of values to be set.
Boolean
Is an operator that can be set to true to update chained controls and triggered events. Default is false.
function button2_onclick(ctrl) { var arr = []; arr.push('ITALY'); arr.push('JAPAN'); IbComposer_setCurrentSelection('listbox1', arr, false); }
How to: |
The IbComposer_execute function executes a report or chart.
IbComposer_execute('reportID', ['outputTarget']);
where:
Alphanumeric
Is the unique identifier of the report or chart to execute.
Alphanumeric
Is the optional parameter to set the target of the output. Is one of the following:
function button3_onclick(ctrl) { IbComposer_execute('report1', 'newwin'); }
How to: |
The IbComposer_isSelected function determines if a control or value is selected.
IbComposer_isSelected('controlID', 'testValue');
where:
Alphanumeric
Is the unique identifier of the control being tested.
Alphanumeric
Is the value the control is being checked against.
function checkbox1_onclick(ctrl){ var curValue = IbComposer_isSelected('checkbox1'); IbComposer_showHtmlElement('form1', curValue); }
How to: |
The IbComposer_showHtmlElement function shows or hides an HTML element.
IbComposer_showHtmlElement('elementID', bShow);
where:
Alphanumeric
Is the unique identifier of the element which is shown or hidden.
Boolean
Is an operator that can be set to true to show the element and false to hide it.
function checkbox1_onclick(ctrl){ var curValue = IbComposer_isSelected('checkbox1'); IbComposer_showHtmlElement('form1', curValue); }
How to: |
The IbComposer_enableHtmlElement function enables or disables an HTML element.
IbComposer_enableHtmlElement('elementID', bEnable);
where:
Alphanumeric
Is the unique identifier of the element which is enabled or disabled.
Boolean
Is an operator that can be set to true to enable the element and false to disable it.
function checkbox2_onclick(ctrl){ IbComposer_enableHtmlElement('listbox1', IbComposer_isSelected('checkbox2', 'country')); IbComposer_enableHtmlElement('combobox1', IbComposer_isSelected('checkbox2', 'car')); IbComposer_enableHtmlElement('listbox2', IbComposer_isSelected('checkbox2', 'model')); IbComposer_enableHtmlElement('combobox2', IbComposer_isSelected('checkbox2', 'dcost')); }
How to: |
The IbComposer_ResetDownChainControls function resets the controls down the chain from the current control to have correct corresponding values.
IbComposer_ResetDownChainControls('ctrl');
where:
Alphanumeric
Is the unique identifier of the first control.
function button4_onclick(ctrl) { var arr = [];arr.push('ENGLAND'); IbComposer_setCurrentSelection('listbox1', arr, false); IbComposer_ResetDownChainControls('listbox1'); }
How to: |
The IbComposer_selectTab function selects the tab specified by the tabNumberToSelect and makes it the active tab.
IbComposer_selectTab('tabControlID', tabNumberToSelect);
where:
Alphanumeric
Is the unique identifier of the tab control being made active.
Integer
Is the number of the tab to make active.
<FORM id=form1 onsubmit="OnExecute(this); IbComposer_selectTab('tab1', 1) name="form1">
How to: |
The onbeforeload event is called before a control is populated with values.
onbeforeload('ctrl', 'arrValuesToLoad');
where:
Alphanumeric
Is the object of the control.
Alphanumeric
Is the array of values that will be loaded into the control.
function listbox1_onbeforeload(ctrl,arrValuesToLoad) { for(var i = 0; i < arrValuesToLoad.length; i++) { alert(arrValuesToLoad[i].dispValue + " " + arrValuesToLoad[i].value + " " + arrValuesToLoad[i].selected); } }
How to: |
The onafterload event is called after a control is populated with values.
onafterload('ctrl');
where:
Alphanumeric
Is the object of the control.
function listbox1_onafterload(ctrl){ alert(IbComposer_isSelected(ctrl.id, 'ALL')); }
WebFOCUS |