Although the HTML canvas is fully integrated with JavaScript, it is suggested that you do not create custom JavaScript that manipulates the HTML canvas 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 canvas run time will call onInitialUpdate() if it exists.
How to: |
IbComposer_removeSelectOption removes values from a list box, drop down, or the 'from' list box of a double list control.
IbComposer_removeSelectOption(controlID,arr[]);
Alphanumeric
Is the unique identifier of the control from which values are obtained.
Alphanumeric Array
Is the array that contains single or multiple values.
Note: When the IbComposer_removeSelectOption method is called, the values specified by the second parameter (arr[]) will be removed.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here var readVals = []; readVals = IbComposer_getCurrentSelection('listbox1'); IbComposer_removeSelectOption('combobox1',readVals); }
How to: |
IbComposer_runAnimation runs the animation defined by the user in the Tasks and Animations panel.
IbComposer_runAnimation(name);
Alphanumeric
Is the name of the animation specified by the user in the Tasks and Animations panel.
function submit1_onclick(event) { IbComposer_runAnimation('animation1'); }
How to: |
IbComposer_triggerExecution allows the user to execute a specific task defined in the Tasks section of the Tasks and Animations panel.
IbComposer_triggerExecution(taskName,index [, paramName, paramValue]);
where:
Alphanumeric
Is the name of the task specified by the user in the Tasks section of the Tasks and Animations panel in the HTML canvas.
Numeric
Is the index value of the action assigned to the task that you want to execute. The first action has an index value of 1, the second an index value of 2, and so on.
Alphanumeric
Optionally, are the name and value of a parameter to be applied when the task is executed. You can specify multiple parameters by using multiple name-value pairs.
The following example executes the first task, called task1, when a button called submit1 is clicked.
function submit1_onclick(event) { IbComposer_triggerExecution('task1',1); }
The following syntax appears in the StyleSheet section of a report procedure. It creates a JavaScript drilldown, launched from a menu item labeled Drill to InfoWindow, that uses the IbComposer_triggerExecution function to execute a task called task2, which has an index value of 1. It sets the value of the parameter &BUSINESS_SUB_REGION to the value selected from the first column in the report (N1). The report is loaded in a frame on the page, as identified by ib_frameName, that has the unique identifier report1.
TYPE=DATA, COLUMN=N1, DRILLMENUITEM='Drill to InfoWindow', JAVASCRIPT=parent.IbComposer_triggerExecution( \ 'task2' \ '1' \ 'BUSINESS_SUB_REGION' \ N1 \ 'ib_frameName' \ 'report1' \ ), TARGET='_parent', $
The report can then be added to an HTML page in a report component called report1. You can then create a task called task2, which is the first task after the load task, in the Tasks & Animations panel. Use a Trigger Type of TBD to set the task to execute when a drill-down link in the report is clicked. You can then specify a request in the Requests/Actions section to be executed using the selected parameter value when a drill-down link is clicked.
How to: |
IbComposer_getRequestRefProcedure returns the name of the procedure, given the unique identifier of the request referencing the procedure. This was formerly available in the myXmlRoot document.
IbComposer_getRequestRefProcedure(Drilldown);
where:
Alphanumeric
Is the name of the request provided.
function button1_onclick(event) { IbComposer_getRequestRefProcedure('Drilldown'); }
How to: |
IbComposer_getRequestTarget returns the name of all the target frames used by the request. This was formerly available in the myXmlRoot document.
IbComposer_getRequestTarget(Drilldown,bShow);
where:
Alphanumeric
Is the name of the request provided.
Boolean
Is an operator that can be set to true to show the names, or set to false to hide them.
function button1_onclick(event) { IbComposer_getRequestTarget('Drilldown','true'); }
How to: |
IbComposer_getMapObject returns the map object for the map container that is passed as the parameter. This object can then be used as a parameter in other API functions.
IbComposer_getMapObject(mapId);
where:
Alphanumeric
Is the unique identifier of the map container.
function onInitialUpdate() { var map = IbComposer_getMapObject('mapcontrol1'); }
How to: |
IbComposer_getMarkers returns an array of markers for a specific layer of a map.
IbComposer_getMarkers(mapId,layerName);
where:
Alphanumeric
Is the unique identifier of the map container.
Alphanumeric
Is the name of the layer for which the markers are returned.
function onInitialUpdate() { var map = IbComposer_getMapObject('mapcontrol1'); var markers = IbComposer_getMarkers('mapcontrol1','Customers'); }
How to: |
IbComposer_populateDynamicCtrl allows you to determine from which control data is drawn from to populate a destination control.
IbComposer_populateDynamicCtrl(controlID,fromControlId);
where:
Alphanumeric
Is the unique identifier of the control from which values are obtained.
Alphanumeric
Is the unique identifier of the control from which values are obtained, when two or more controls are chained to a destination control. For example, if listbox1 and listbox2 are both chained to listbox3, by default, the values of listbox3 will be determined by listbox1. You can use IbComposer_populateDynamicCtrl('listbox3','listbox2') to make listbox2 determine the values of listbox3. This identifier is optional.
function button3_onclick(event) { var acc = IbComposer_populateDynamicCtrl('listbox3','listbox2'); acc.selectNextPage(); }
How to: |
IbComposer_getComponentById obtains a component by using its ID.
IbComposer_getComponentById(controlID);
where:
Alphanumeric
Is the unique identifier of the control from which values are obtained.
function button3_onclick(event) { var acc = IbComposer_getComponentById('accordion1'); acc.selectNextPage(); }
How to: |
IbComposer_getCurrentSelection retrieves the current selected values from a control.
IbComposer_getCurrentSelection(controlID,[layer],[bDateObj]);
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.
Boolean
Is an optional operator that can be set to true to return a date object or to false to return a string. If you do not specify a value for this operator, it returns a string.
function button1_onclick(event) { var values = IbComposer_getCurrentSelection('combobox1'); for(var i = 0; i < values.length; i++) alert(values[i]); }
How to: |
IbComposer_getCurrentSelectionEx retrieves the current selected actual or display values from a control. The function can also be used to get the index values for List Boxes, Drop Down Lists, and Double Lists.
IbComposer_getCurrentSelectionEx(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 0 for the first layer.
function button1_onclick(event) { var values = IbComposer_getCurrentSelectionEx('combobox1'); for(var i = 0; i < values.length; i++) { alert("Index Value: " + values[i].getIndex() + "\n" + "Actual Value: " + values[i].getValue() + "\n" + "Display Value: " + values[i].getDisplayValue()); }
How to: |
IbComposer_getClickedRow retrieves the current clicked row of an HTML table.
IbComposer_getClickedRow(clickEventTarget);
where:
Alphanumeric
Is the name of the event for the clicked row.
function IbComposer_getClickedRow(clickEventTarget) { return getCurrentClickedRow(clickEventTarget); }
How to: |
IbComposer_getClickedColumn retrieves the current clicked column of an HTML table.
IbComposer_getClickedColumn(clickEventTarget);
where:
Alphanumeric
Is the name of the event for the clicked column.
function IbComposer_getClickedColumn(clickEventTarget) { return getCurrentClickedColumn(clickEventTarget); }
How to: |
IbComposer_getClickedCellValue retrieves the current clicked cell value of an HTML table.
IbComposer_getClickedCellValue(clickEventTarget);
where:
Alphanumeric
Is the name of the event for the clicked cell.
function IbComposer_getClickedCellValue(clickEventTarget) { return getClickedCellValue(clickEventTarget); }
How to: |
IbComposer_setCurrentSelection 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. The default is false.
The following example selects the values ITALY and JAPAN from a multiselect list box called listbox1.
function button1_onclick(event) { var arr = []; arr.push('ITALY'); arr.push('JAPAN'); IbComposer_setCurrentSelection('listbox1',arr,'false'); }
How to: |
IbComposer_execute 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(event) { IbComposer_execute('report1','newwin'); }
How to: |
IbComposer_isSelected 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 optional parameter the control is being checked against.
function checkbox1_onclick(event) { var curValue = IbComposer_isSelected('checkbox1'); IbComposer_showHtmlElement('form1',curValue); }
How to: |
IbComposer_showHtmlElement 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(event) { var curValue = IbComposer_isSelected('checkbox1'); IbComposer_showHtmlElement('form1',curValue); }
How to: |
IbComposer_enableHtmlElement 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(event) { 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: |
IbComposer_ResetDownChainControls 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(event) { var arr = [];arr.push('ENGLAND'); IbComposer_setCurrentSelection('listbox1',arr,'false'); IbComposer_ResetDownChainControls('listbox1'); }
How to: |
IbComposer_selectTab 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: |
IbComposer_selectTemplateTab selects a tab on a template page and makes it the active tab.
IbComposer_selectTemplateTab(tabId);
where:
Alphanumeric
Is the unique identifier of the tab control being made active.
function submit1_onclick(event) { IbComposer_selectTemplateTab('tab5'); }
How to: |
IbComposer_goToPageOfMultiPageControl selects a page in a multipage control, such as a tab, accordion, or window.
IbComposer_goToPageOfMultiPageControl(controlID, page)
where:
Alphanumeric
Is the unique identifier of the control from which values are obtained.
Alphanumeric
Specifies a page number (for example 1, 2, and so on), or true for the previous page and false for the next page.
The following example shows how to select a page in a window multipage control. In this example, the control will start on page 3.
function button2_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_goToPageOfMultiPageControl('windowPanel1', '3'); }
The following example shows how to select the previous page in a window multipage control.
function button2_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_goToPageOfMultiPageControl('windowPanel1', 'true'); }
The following example shows how to select the next page in a window multipage control.
function button2_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_goToPageOfMultiPageControl('windowPanel1', 'false'); }
How to: |
IbComposer_getAllAmpersValues is used to retrieve the current selected values from all the controls on your page layout. It then takes those values and assembles them as a string that can be added to the end of a URL call. An example of this would be having a REGION control and multiselecting MidEast, NorthEast, and NorthWest. It will assemble these selections as shown below:
®ION=%27MidEast%27%20OR%20%27NorthEast%27%20OR%20%27NorthWest%27
This function can be used in conjunction with the Business Intelligence Portal, where the generated string is appended to all Business Intelligence Portal calls that run reports or charts. This allows the parameter values to affect all portal components, even if new ones are added or existing ones are removed at run time.
IbComposer_getAllAmpersValues([verifySelection]);
where:
Boolean
Is an optional parameter. When true and when the Selection required property for the control is set to Yes, this returns an empty string for the parameter controls that do not have a selection made.
Please make required selections
function button1_onclick(event) { var val = IbComposer_getAllAmpersValues(); alert(val); OnExecute(event); }
How to: |
IbComposer_showLayer shows or hides the specified layer.
IbComposer_showLayer(layerName,bShow);
where:
Alphanumeric
Is the name of the layer, which will be shown or hidden.
Is an operator that can be set to true to show the layer or false to hide it.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_showLayer('Customers','true'); }
How to: |
IbComposer_toggleMapLayer toggles the visibility of the specified layer.
IbComposer_toggleMapLayer(mapId,layerName);
where:
Alphanumeric
Is the unique identifier of the map control.
Alphanumeric
Is the unique identifier of a layer within the map.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_toggleMapLayer('mapcontrol1','Customers'); }
How to: |
IbComposer_toggleMapMarker toggles the visibility of the specified marker.
IbComposer_toggleMapMarker(mapId,layerName,markerName);
where:
Alphanumeric
Is the unique identifier of the map control.
Alphanumeric
Is the unique identifier of a layer within the map.
Alphanumeric
Is the unique identifier of a marker within the map.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_toggleMapMarker('mapcontrol1','Stores','EMart'); }
How to: |
IbComposer_refreshMapLayer refreshes the specified layer from the database.
IbComposer_refreshMapLayer(mapId,layerName);
where:
Alphanumeric
Is the unique identifier of the map control.
Alphanumeric
Is the unique identifier of a layer within the map.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_refreshMapLayer('mapcontrol1','Customers'); }
How to: |
IbComposer_panToAddress allows the user to pan to the point on a map for the specified address and zoom level.
IbComposer_panToAddress(address,mapId,zoom);
where:
Alphanumeric
Is the address you want to pan to.
Alphanumeric
Is the unique identifier of the map control.
Integer
Is how much you wish to zoom.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_panToAddress('2 Penn Plaza,NY,NY','mapcontrol1',10); }
How to: |
ibComposer_panToPoint allows the user to pan to the point on a map for the specified coordinates and zoom level.
IbComposer_panToPoint(lat,long,mapId,zoom);
where:
Integer
Is the latitude coordinate of the point you want to pan to.
Integer
Is the longitude coordinate of the point you want to pan to.
Alphanumeric
Is the unique identifier of the map control.
Integer
Is how much you wish to zoom.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_panToPoint(37.0625,-95.677068,'mapcontrol1',5); }
How to: |
IbComposer_preventModifyIFrameDocument can prevent CSS modification of any iframe within a document, by calling it from onInitialUpdate.
function onInitialUpdate() { IbComposer_preventIFrameUpdates();}
How to: |
IbComposer_showAllMapMarkers displays all markers for the specified layer.
IbComposer_showAllMapMarkers(mapId,layerName);
where:
Alphanumeric
Is the unique identifier of the map control.
Alphanumeric
Is the unique identifier of a layer within the map.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_showAllMapMarkers('mapcontrol1','Customers'); }
How to: |
IbComposer_drawBullseye draws a bullseye at a point on the map. This function has optional parameters to select whether to display markers, the units of measure used for the bullseye, the number of rings, the size of the rings, and the color of the rings.
IbComposer_drawBullseye(mapId,lat,long,selectmarkers,units, rings,[list-of-sizes],[list-of-colors]);
where:
Alphanumeric
Is the unique identifier of the map control.
Integer
Is the latitude coordinate of the point you want to pan to.
Integer
Is the longitude coordinate of the point you want to pan to.
Boolean
Is an operator that, when set to true, selects all markers within the Bullseye.
Alphanumeric
The unit of measure for the Bullseye rings.
Integer
The number of rings the bullseye uses.
Integer
Is an optional parameter, as a comma (,) separated list of sizes for the bullseye rings. For example, 1, 3, 5.
Alphanumeric
Is an optional parameter, as a comma (,) separated list of colors for the bullseye rings. The colors can be RGB values or hexadecimal values. For example, Blue or #FFFF.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here IbComposer_drawBullseye('mapcontrol1',37.0625,-95.677068,'true','mi',3); }
How to: |
IbComposer_setCalendarDatesRange sets the range for the target calendar, given the date on the source calendar and a range in days.
IbComposer_setCalendarDatesRange(elementId, fromDate, toDate)
where:
Alphanumeric
Is the unique identifier of the target calendar control for which you want to set the date range.
Date object
Is the value of the date from the source calendar.
Note: This can be obtained by using the IbComposer_getCurrentSelection function. This function should have the third parameter set to True to return a Date object.
Date object
This value must be calculated using fromDate and the number of days needed to show the range.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here var curDate = IbComposer_getCurrentSelection('calendar1', 0, true); var fromDate= new Date(curDate); var toDate = new Date(); var nOfDays= IbComposer_getCurrentSelection('slider1'); if (isNaN (nOfDays-0)&& nOfDays != null) { alert("Please enter a numeric value!!"); } else { var time = fromDate.getTime()+(nOfDays*3600000 * 24); toDate.setTime(time); IbComposer_setCalendarDatesRange("calendar2", fromDate, toDate); } }
The IbComposer_loadNextGroup function allows you to load the next group in a table.
IbComposer_loadNextGroup("tableId", groupObject, updateDependencies);
where:
Alphanumeric
Is the unique identifier of the table from which to load the next group.
Object
Is an object representing the group displayed in the table.
Boolean
If true, controls chained to the table are updated when IbComposer_loadNextGroup is executed. If false, they are not updated.
In the following example, clicking a button with the unique identifier next loads the next group of the table, called tablectrl1, using the IbComposer_loadNextGroup function. A button called prev, which executes the IbComposer_loadPrevGroup function, is not enabled until you have executed IbComposer_loadNextGroup for the first time, so that it is only available if there is a previous group to display. The next button is not available if the last group in the table is displayed.
In order to execute properly, a variable called numOfRows has been used to set the length of the displayed group to 3 rows.
var numOfRows=3; function tablectrl1_onbeforeload(ctrl,arrValuesToLoad) { if(IbComposer_isCompleteReloading("tablectrl1") && arrValuesToLoad.length>numOfRows) { IbComposer_enableHtmlElement("prev",false); IbComposer_enableHtmlElement("next",true); return numOfRows; } return false; } function next_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here var groupObj = {}; IbComposer_loadNextGroup("tablectrl1", groupObj, false); IbComposer_enableHtmlElement("prev",true); if(groupObj.end== groupObj.total) IbComposer_enableHtmlElement("next",false); }
The IbComposer_loadPrevGroup function allows you to load the previous group in a table.
IbComposer_loadPrevGroup("tableId", groupObject, updateDependencies);
where:
Alphanumeric
Is the unique identifier of the table from which to load the next group.
Object
Is an object representing the group displayed in the table.
Boolean
If true, controls chained to the table are updated when IbComposer_loadPrevGroup is executed. If false, they are not updated.
In the following example, clicking a button with the unique identifier prev loads the previous group of the table, called tablectrl1, using the IbComposer_loadPrevGroup function. The prev button is not available if you are viewing the first group in the table, so that it is only available if there is a previous group to display. You must click the button called next, which executes the IbComposer_loadNextGroup function, in order to enable it.
In order to execute properly, a variable called numOfRows has been used to set the length of the displayed group to 3 rows.
var numOfRows=3; function tablectrl1_onbeforeload(ctrl,arrValuesToLoad) { if(IbComposer_isCompleteReloading("tablectrl1") && arrValuesToLoad.length>numOfRows) { IbComposer_enableHtmlElement("prev",false); IbComposer_enableHtmlElement("next",true); return numOfRows; } return false; } function prev_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here var groupObj = {}; IbComposer_loadPrevGroup("tablectrl1", groupObj, false); IbComposer_enableHtmlElement("next",true); if(groupObj.begin== 1) IbComposer_enableHtmlElement("prev",false); }
The IbComposer_isCompleteReloading can be used to check if an element has finished reloading. It returns true if the element has reloaded, and false if it has not.
IbComposer_isCompleteReloading("elementId");
where:
Alphanumeric
Is the unique identifier of the element whose reloading status you are checking.
In the following example, clicking a button with the unique identifier button1 displays a message indicating whether or not a table called tablectrl1 has finished reloading.
function button1_onclick(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here alert(IbComposer_isCompleteReloading("tablectrl1")) }
When creating an Esri map that uses image markers in an HTML page, you can use the getImageScale function to enable the images to scale as you zoom in and out of the map. This helps to prevent the image markers from excessively overlapping as you zoom out of the map, making it more readable, while also maintaining reasonable image sizes as you zoom in. You can also set the maximum and minimum size of the images so that they comfortably fit on your map, regardless of how many markers it contains.
The getImageScale function does not require an event, and can be added directly to your embedded JavaScript.
function getImageScale(layerName, scaleObj) { scaleObj.scale=boolean; scaleObj.minSz=minSize; scaleObj.maxSz=maxSize; }
where:
Is a static value that does not need to be set. All map layers using image markers are affected by the getImageScale function.
This name, for example, scaleObj, should match the name of the objects for the scale, minSz, and maxSz properties.
Boolean
Type true to enable image resizing, or false to disable.
Integer
The minimum height, in pixels, of the image. The minimum size is used when fully zoomed out of the map. This value overrides the sizes set for the image marker in the Settings panel, but the height to width ratio is maintained.
Integer
The maximum height, in pixels, of the image. The maximum size is used when fully zoomed into the map. This value overrides the sizes set for the image marker in the Settings panel, but the height to width ratio is maintained.
In the following example, the minimum size of all image markers in the map is set to 15 pixels, and the maximum size is set to 60 pixels. When you run the HTML page, the markers expand up to a height of 60 pixels as you zoom in, and shrink down to a height of 15 pixels as you zoom out.
function getImageScale(layerName, scaleObj) { scaleObj.scale=true; scaleObj.minSz=15; scaleObj.maxSz=60; }
In addition to the typical event handlers, such as onclick, there are two event handlers that enable you to perform an action before a control is loaded and after a control is loaded.
The following example uses the onbeforeload event handler to modify the value DATSUN with the display value of Modified.
//Begin function listbox1_onbeforeload function listbox1_onbeforeload(ctrl,arrValuesToLoad) { for(var i = 0; i < arrValuesToLoad.length; i++) { //alert(arrValuesToLoad[i].dispValue + " " + arrValuesToLoad[i].value + " " + arrValuesToLoad[i].selected); if (arrValuesToLoad[i].value == 'DATSUN') { arrValuesToLoad[i].dispValue = 'Modified'; } } } //End function listbox1_onbeforeload
The following example uses the onafterload event handler to copy values from one control to another.
//Begin function listbox1_onafterload function listbox1_onafterload(ctrl) { IbComposer_getComponentById("listbox2").innerHTML = IbComposer_getComponentById("listbox1").innerHTML } //End function listbox1_onafterload
Note: If a control has more than 100 values, WebFOCUS App Studio will load only 100 values at a time, repeatedly, until all values are loaded. You will need to modify the JavaScript, as follows:
function listbox1_onafterload(ctrl) { if (arguments && arguments.length==2 && arguments[1]) IbComposer_getComponentById("listbox2").innerHTML = IbComposer_getComponentById("listbox1").innerHTML }
This JavaScript will be called incrementally after each 100 items are added to the list box drop-down control. An additional parameter (a boolean value true/false arguments[1]) will be sent. It will be set to false for each incremental load of 100 items, and true for the final call.