Skip to content

InsertDynamicObjectAtIndex - cWebDynamicObjectContainer

Inserts a dynamic object at a certain index in its parent's list of childen

Type: Procedure

Parameters

Parameter Type Description
sDynamicObjectId String Unique identifier for the dynamic object within this container
sParentId String Dynamic object id of the parent object, if the object should be at the root of the container then pass an empty string ""
iInsertIndex Integer zero-based index of the parent object's list of children where to insert the object

Syntax

Procedure InsertDynamicObjectAtIndex String sDynamicObjectId String sParentId Integer iInsertIndex

Call Example

Send InsertDynamicObjectAtIndex sDynamicObjectId sParentId iInsertIndex

Description

Inserts a dynamic object at a certain index in its parent's list of childen.

Sample

This sample inserts dynamic object oGroup2 after dynamic object oGroup1 and then inserts oForm2 as the first object (index 0) of oGroup2, shifting oForm to position 2 (index 1).

Get CreateDynamicObject of oContainer (RefClass(cWebGroup)) "oGroup2" "" to hoGroup2
Send InitDynamicProp of hoGroup2 "piColumnCount" 8
Get CreateDynamicObject of oContainer (RefClass(cWebForm)) "oForm" "oGroup2" to hoForm
Send InitDynamicProp of hoForm "piColumnSpan" 8 
Send InitDynamicProp of hoForm "psLabel" "My form"
Send InsertDynamicObject of oContainer "oGroup2" "oGroup1"

Get CreateDynamicObject of oContainer (RefClass(cWebForm)) "oForm2" "oGroup2" to hoForm2
Send InitDynamicProp of hoForm2 "piColumnSpan" 8 
Send InitDynamicProp of hoForm2 "psLabel" "My form2"
Send InsertDynamicObjectAtIndex of oContainer "oForm2" "oGroup2" 0