Show TOC

createItem MethodLocate this document in the navigation structure

Use

createItem(collectionID, itemID, title, tooltip, target, argument, overwrite, sortOrder, parentID, itemType, enabled, iconURI)

Creates an item according to the specified parameters, and adds it to the specified collection

Parameter

Description

collectionID

ID of the collection in which to create the item

itemID

Item ID. If an item with this ID exists, it is replaced in the collection by the new item, if overwrite is true.

title

Item title displayed in the UI, for example, in DTN or masthead. An existing item with this title is replaced in the collection by the new item, if overwrite is true.

tooltip (optional)

Item tooltip. If not specified, title is used as the tooltip.

target (optional)

A valid target can be either of:

  • URI of a navigation target, as a string

  • JavaScript callback function, as a reference. For example, myItemHandler(itemID, argument).

argument (optional)

A string argument that is passed to the callback function. Should be specified if the target is a JavaScript callback function.

overwrite (optional)

Defines whether to overwrite an existing item with the same itemID or title. Default value is false.

sortOrder (optional)

Defines the relative position of the item among other items. Aligned with the navigation priority mechanism: an integer from 1 to 100, where 1 has the highest priority.

parentID (optional)

ID of the parent item (folder) in the collection that should contain the new item. Relevant for nested collections (currently only for menus); for other collection types, a null value is expected.

itemType (optional)

Currently, not supported. Pass a null value.

enabled (optional)

Boolean value defining whether the item appears enabled or disabled (grayed out)

iconURI (optional)

URI of the icon associated with the collection item: either the full path ( http://... ), or a path relative to the application, such as /<application name>/images/<file> , or a PCD path in the Web resource repository.

Supported icon formats are GIF, PNG, and JPEG.

Return Value

  • True, if the item was created and added to the collection

  • False, if the item was not created because an item with the specified itemID or title already exists in the specified collection.