Show TOC

Function documentationiBrowser Events and Methods Locate this document in the navigation structure

 

The SAP Manufacturing Integration and Intelligence (SAP MII) iBrowser applet supports the SelectionEvent and DoubleClickEvent applet parameters that allow JavaScript functions to be associated with the user clicking on an item in the tree or list.

You can use the iBrowserObject getBrowserObject() method to return a browser component object.

The following table lists common methods you can use with browsers:

Method

Use

int getIndexOf(String sItem)

If the browser is not in tree view mode, this method returns the index of the string sItem in the control data set. The first item has an index of one.

int getItemCount()

Gets the number of all items in the browser

int getSelectedIndex()

Returns an integer that represents the index of the selected item

int getSelectedItemCount()

If Multiple Selection Mode is selected, this method gets the number of selected items.

setSelectedItemByDatalinkValue(value)

Sets the selected item based on a matching data link value

setUniqueValues(newvalue)

Ensures that the browser object does not contain duplicate values

String getDatalinkValueAt(index)

Returns a string value for the data linked value at the specified index

String getItemAt(int itemNo)

Gets the value of an item based on the item index. The first item has an index of one

String getSelectedDatalinkValue()

Gets the data link value of the selected item

String getSelectedDatalinkValueAt(int itemNo)

Gets the data link value of the selected item based on the selected index. You can use it with getSelectedItemCount() to determine the number of items and then iterate through the list.

String getSelectedItem()

Gets the value of the selected item. If you are using a mode that displays the item information as name (description), the description is not shown when you call this method.

String getSelectedItemAt(int itemNo)

Gets the value of the selected item based on the selected index. The first item has an index of one. You can use this method with the getSelectedItemCount() method to determine the number of selected items.

String getSelectedPath()

Gets a fully qualified path name that includes the names of the selected node and all parent nodes with a forward slash between each level.

void addItem(String strItemtoAdd)

If the browser is in list or dropdown list mode, this method adds an item to the list.

void addItemWithDatalink(String Item, String DatalinkValue)

Adds your own data link item to a drop-down list. For example, a query may return a list of equipment names that you use to filter downtime events. The names are displayed in the drop-down list, but the equipment identification numbers are used as the data link items for filtering the downtime event query. You may want to have an ALL entry in the list that uses a wildcard datalink such as the percent sign.

void insertItem(String strItemtoInsert, int nIndex)

If the browser is in list or dropdown list mode, this method adds an item to the list at the indicated index. The first item has an index of one.

void insertItemWithDatalink(String Item, int Position, String DatalinkValue)

Similar to addItemWithDatalink but allows you to position the item in the list. To have the ALL entry first in the list, set the Position parameter to zero.

void removeAll()

If the browser is in list or dropdown mode, this method removes all items.

void removeItem(String strItemtoBeRemoved)

If the browser is in list or dropdown mode, this method removes an item based on a string value match.

void setDatalinkMode (boolean)

If set to true, the query returns two columns. The value of the second column is stored as a data linked value for each item in a list or drop-down list. You can access the values using the getSelectedDatalinkValue() or getDatalinkValueAt(index) methods.

void setSelectedItem(String itemToSelect)

If you are using a list or tree browser, this method sets the selected item based on the string value match. If multiple items match in a tree browser, only the first matching item is selected.

void setSelectedItemByIndex(int itemNo)

If you are using a list or dropdown list browser, this method sets the selected item based on the item index. The first item has an index of one.

void setSelectedPath(String pathToSelect)

Sets the selected path for a tree browser based on a string value match

void updateBrowser(boolean bUpdate)

If the parameter is true, the system rereads the underlying data. If the query is time-based, the refresh() method updates the start and end dates based on the current time less the duration units. The updateBrowser method does not change the start and end dates.