Help Center

Local Navigation

Object: NamedFrameMap

Availability

BlackBerry® Device Software version 4.6 or later

The NamedFrameMap object represents collections of frames that can be accessed by name.

You can access an individual frame within a collection by its index position using NamedFrameMap.item(), by its name or id attribute using NamedFrameMap.getNamedItem(), or you can index the object directly. For example, if you create an instance of a NamedFrameMap object called myNamedFrameMap, then specifying

myNamedFrameMap.item(2)

myNamedFrameMap.getNamedItem(“item”)

is equivalent to specifying

myNamedFrameMap[2]

myNamedFrameMap[“item”]

NamedFrameMap properties

Property name

Type

Description

Status

Availability

length

unsigned long

Returns the number of nodes in the map.

read only

4.6 or later

NamedFrameMap methods

Method name

Description

Availability

getNamedItem()

Retrieves the frame with the given name.

4.6 or later

item()

Returns the frame at the given index in the map.

4.6 or later

Method: NamedFrameMap.item()

Availability

BlackBerry® Device Software version 4.6 or later

The item() method returns the frame at the specified index in the map.

Syntax

NamedFrameMap.item( index )

Parameters

Parameter

Type

Description

index

int

An integer that represents the frame’s position in the frame map. Valid values are between 0 and NamedFrameMap.length-1 inclusive.

Return values

Returns the frame at the indexth position in NamedFrameMap, or null if an invalid index position is specified.

Exceptions

None.

Method: NamedFrameMap.getNamedItem()

Availability

BlackBerry® Device Software version 4.6 or later

The getNamedItem() method retrieves the frame with the given name.

Syntax

NamedFrameMap.getNamedItem( name )

Parameters

Parameter

Type

Description

name

String

The value of the Node.nodeName property of the frame to retrieve.

Return values

Returns the frame with a Node.nodeName value of name, or null if the given parameter does not identify any existing frame in the map.

Exceptions

None.


Was this information helpful? Send us your comments.