pp108 : removeDuplicates()

removeDuplicates()


It removes any options and their duplicates from the Select and List controls

Syntax

Script

optionsCollection = ControlID.removeDuplicates(oOptions, bTransaction)


Return Value


Returns a collection of option objects that are currently available in the List or Select controls. The returned options contain the xml property, which contains their XML data node, and the businessObject property, which represents the business object to which the data is bound.

Parameters

Parameter

Description

aOptions

Denotes the option array, which is the result of the getSelectedOptions() or getAllOptions() methods.

bTransaction

Boolean which denotes whether the object has to be updated for transaction. The default value is true, which means any change will trigger the onchange event, and the business object is updated.


Remarks


This method takes an array of options as its first parameter and removes those options and their duplicates from the Select or List control on which it was invoked.

Example

This sample code demonstrates how the method can be used.

// get the list options in the select box
var optionsArray = selectBoxID.getSelectedOptions();  
optionsCollection = SelectBoxID.removeDuplicates(optionsArray, true);

Applies to


Select, List