# Portal

(part of package '[Servoy Core](/reference/servoyextensions/packages/ui-component-packages/servoy-core.md)')\
Extends designtime/SolutionModel: [JSWebComponent](/reference/servoycore/dev-api/solutionmodel/jswebcomponent.md)\
Extends runtime: [RuntimeWebComponent](/reference/servoycore/dev-api/forms/runtimeform/elements/runtimewebcomponent.md)

A Servoy Extra Component that displays a portal for viewing and editing related foundset records.

This is a reference page; many components have detailed usage guides [here](https://docs.servoy.com/guides/develop/application-design/ui-components).

## Properties

### background

The background color for the portal component. Type: [Color](/reference/servoy-developer/component_and_service_property_types.md#color)

***

### borderType

The type of border applied to the portal. Type: [Border](/reference/servoy-developer/component_and_service_property_types.md#border)

***

### editable

Flag indicating whether the portal is editable. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: true

***

### enabled

Flag indicating whether the portal is enabled for user interaction. Type: [Enabled](/reference/servoy-developer/component_and_service_property_types.md#protected) Default Value: true

***

### foreground

The foreground color for the portal component. Type: [Color](/reference/servoy-developer/component_and_service_property_types.md#color)

***

### headerHeight

The height of the portal header in pixels. Type: [Number](/reference/servoycore/dev-api/js-lib/number.md) Default Value: 32

***

### initialSort

The initial sort order for the portal, specified as a string. Type: [String](/reference/servoycore/dev-api/js-lib/string.md)

***

### intercellSpacing

The spacing between cells in the portal. Type: [Dimension](https://github.com/Servoy/gitbook/blob/master/reference/servoycore/dev-api/js-lib/dimension.md)

***

### location

The location of the portal on the form. Type: [Point](https://github.com/Servoy/gitbook/blob/master/reference/servoycore/dev-api/js-lib/point.md)

***

### multiLine

Flag indicating whether the portal supports multiple lines. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### readOnlyMode

The read-only mode setting for the portal. Type: [Protected](/reference/servoy-developer/component_and_service_property_types.md#protected) Default Value: null

***

### relatedFoundset

The foundset related to the portal. Type: [JSFoundset](/reference/servoycore/dev-api/database-manager/jsfoundset.md)

***

### reorderable

Flag indicating whether the portal supports reordering of records. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### resizable

Flag indicating whether the portal is resizable. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### resizeble

(Deprecated) Duplicate property for resizable. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### rowBGColorCalculation

Calculation used to determine the row background color. Type: [String](/reference/servoycore/dev-api/js-lib/string.md)

***

### rowHeight

The height of each row in the portal. Type: [Number](/reference/servoycore/dev-api/js-lib/number.md)

***

### scrollbars

Configuration for scrollbars in the portal. Type: [Scrollbars](/reference/servoy-developer/component_and_service_property_types.md#scrollbars)

***

### showHorizontalLines

Flag indicating whether horizontal grid lines are shown. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### showVerticalLines

Flag indicating whether vertical grid lines are shown. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### sortable

Flag indicating whether the portal is sortable. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### styleClass

CSS style classes applied to the portal. Type: [String](/reference/servoycore/dev-api/js-lib/string.md)

***

### tabSeq

The tab sequence order for keyboard navigation. Type: [Tabseq](/reference/servoy-developer/component_and_service_property_types.md#tabseq)

***

### transparent

Flag indicating whether the portal background is transparent. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***

### visible

Flag indicating whether the portal is visible. Type: [Visible](/reference/servoy-developer/component_and_service_property_types.md#visible)

***

## Events

### onDragEndMethodID(event)

Called when a drag operation ends on the portal.

**Parameters:**

> * {[JSDNDEvent](/reference/servoycore/dev-api/application/jsdndevent.md)} event The event object associated with the drag end.

***

### onDragMethodID(event)

Called during a drag operation over the portal.

**Parameters:**

> * {[JSDNDEvent](/reference/servoycore/dev-api/application/jsdndevent.md)} event The event object associated with the drag.

**Returns:** {[Number](/reference/servoycore/dev-api/js-lib/number.md)}

***

### onDragOverMethodID(event)

Called when an element is dragged over the portal.

**Parameters:**

> * {[JSDNDEvent](/reference/servoycore/dev-api/application/jsdndevent.md)} event The event object associated with the drag over.

**Returns:** {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)}

***

### onDropMethodID(event)

Called when an element is dropped onto the portal.

**Parameters:**

> * {[JSDNDEvent](/reference/servoycore/dev-api/application/jsdndevent.md)} event The event object associated with the drop.

**Returns:** {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)}

***

## API

### deleteRecord()

Deletes the currently selected record from the portal's foundset.

***

### duplicateRecord(addOnTop)

Duplicates the currently selected record in the portal's foundset.

**Parameters:**

> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[addOnTop] Whether to add the duplicated record at the top of the foundset.

***

### getFormName()

Retrieves the name of the form that the portal is associated with.

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The name of the form containing the portal.

***

### getHeight()

Retrieves the height of the portal component.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The height of the portal in pixels.

***

### getLocationX()

Retrieves the X-coordinate (horizontal position) of the portal component.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The X-coordinate of the portal in pixels.

***

### getLocationY()

Retrieves the Y-coordinate (vertical position) of the portal component.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The Y-coordinate of the portal in pixels.

***

### getMaxRecordIndex()

Retrieves the maximum record index available in the portal's foundset.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The total number of records in the related foundset.

***

### getScrollX()

Retrieves the current horizontal scroll position of the portal.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The horizontal scroll position in pixels. Always returns 0, as scrolling is not implemented for web.

***

### getScrollY()

Retrieves the current vertical scroll position of the portal.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The vertical scroll position in pixels. Always returns 0, as scrolling is not implemented for web.

***

### getSelectedIndex()

Retrieves the index of the currently selected record in the portal's foundset.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The 1-based index of the selected record, or -1 if no record is selected.

***

### getSortColumns()

Retrieves the sorting columns applied to the portal's related foundset.

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) A string representing the current sort order of the foundset, formatted as a comma-separated list of column names followed by sort directions (ASC or DESC).

***

### getWidth()

Retrieves the width of the portal component.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The width of the portal in pixels.

***

### newRecord(addOnTop)

Creates a new record in the portal's foundset.

**Parameters:**

> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[addOnTop] Whether to add the new record at the top of the foundset.

***

### setScroll(x,y)

Sets the scroll position of the portal.

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} x The horizontal scroll position in pixels.
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} y The vertical scroll position in pixels.

***

### setSelectedIndex(index)

Sets the selected record index in the portal's foundset.

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} index The 1-based index of the record to be selected.

***

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoyextensions/ui-components/form-containers/portal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
