Reference > Functions reference > Logical functions > GetLayoutObjectAttribute
 

GetLayoutObjectAttribute

Returns the specified attributes of the layout object given by the objectName currently active in the calculation.

Format 

GetLayoutObjectAttribute(objectName; attributeName{;repetitionNumber; portalRowNumber})

Parameters 

objectName - the name of a named layout object on the current layout.

attributeName - the name of a supported attribute (see below).

repetitionNumber - the repetition number (for repeating fields).

portalRowNumber - the number of the row in the portal.

Parameters in braces { } are optional.

Data type returned 

text

Originated in 

FileMaker Pro 8.5

Attributes

 

Attribute

Returns

Data type returned

objectType

The object's type, in English.

text

hasFocus

1 if objectName has focus; otherwise, returns 0. Objects that can have the focus are fields, portals, tab panels, slide panels, buttons, popover buttons, charts, and groups. Also returns 1 for a portal when a portal row is selected.

number

containsFocus

1 if objectName has focus or if it contains an object that has focus; otherwise, returns 0. Objects that can contain the focus are fields, portals, tab panels, slide panels, button bars, buttons, popover buttons, popovers, charts, and groups.

number

isFrontPanel

1 if the target object is the tab or slide panel that is in front.

number

isActive

1 if the target object is currently active; otherwise, returns 0.

number

isObjectHidden

1 if objectName is hidden for the current record; otherwise, returns 0. Returns 1 for objects other than popovers that are to the right of the layout boundary.

number

bounds

A list of numeric values, separated by spaces, that describes the placement of the specified object (top-left to bottom-right) and its rotation.

text

left

The left edge coordinate of the specified object.

number

right

The right edge coordinate of the specified object.

number

top

The top edge coordinate of the specified object.

number

bottom

The bottom edge coordinate of the specified object.

number

width

The width of the specified object.

number

height

The height of the specified object.

number

rotation

The rotation (in degrees) of the specified object.

number

startPoint,
endPoint

A pair of numeric values (horizontal, vertical), separated by spaces, that represent the start point or end point of a line object. Other objects return the top-left point for startPoint and the bottom-right point for endPoint.

text

source

The source description of the specified object as follows.

web viewers - returns current URL.

fields - returns the fully qualified field name (table name::field name).

text objects - returns the text (does not return merge fields).

portals - returns the table name.

graphics - returns image data such as the image filename.

charts - returns the XML description of a chart object.

all other objects - returns an empty string.

text

content

The content of the specified object as follows.

web viewers - returns the current content (such as HTML code).

fields - returns the field data formatted using the specified object's properties.

text objects - returns the text (including text from merge fields).

graphics - returns image data, such as the name of a file in a container field if the image is stored (in the field or externally), or the reference to the file if the image is unstored.

charts - returns the bitmap representation of a chart object.

buttons and popover buttons - returns the button’s text.

all other objects - returns an empty string.

text

enclosingObject

The objectName of the enclosing layout object; otherwise, returns an empty string. Only groups, tab panels, slide panels, button bars, popover buttons, popovers, and portals can contain other objects.

text

containedObjects

A list of named objects contained within objectName. Only groups, tab panels, slide panels, button bars, popover buttons, popovers, and portals can contain other objects.

text

Notes 

The object coordinates are given in points relative to the top-left corner of the primary screen’s work area. The work area is the screen area excluding the taskbar (Windows) or the screen area excluding the menu bar and the Dock (macOS). In iOS, the work area is the entire screen. Attributes using these coordinates are bounds, left, top, bottom, startPoint, and endPoint.

In FileMaker WebDirect, when this function acts on a web viewer or a chart, the content and source attributes return an empty string.

If objects are set to auto-resize, attributes returned are based on the resized bounds of the object in its current state.

In FileMaker WebDirect, attributes are based on the bounds of the object when FileMaker WebDirect last communicated layout data with the server, such as when the user switched to the layout.

If objects are located above the status toolbar, negative coordinate values are returned.

When repetitionNumber or portalRowNumber is 0, the function behaves as if the parameter was not specified. For portalRowNumber, the function returns data from the first portal row. For repetitionNumber, the function acts on the first repetition (for returning content or source) or acts on the entire field as a whole (for returning bounds). Both parameters are necessary because you must be able to reference a particular field repetition within a particular portal row.

Example 1 

Stores a web viewer's current URL in the Search::Homepage field.

Set Field [Search::Homepage ; GetLayoutObjectAttribute ( "Web Viewer" ; "source" )]

Related topics 

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas

Naming objects