Skip to content

MoveDynamicObjectToIndex - cWebDynamicObjectContainer

Moves a dynamic object to a specific index inside a parent object

Type: Procedure

Parameters

Parameter Type Description
sDynamicObjectId String Dynamic object to move
sParentId String Id of the new parent object
iInsertIndex Integer Index to move the object to

Syntax

Procedure MoveDynamicObjectToIndex String sDynamicObjectId String sParentId Integer iInsertIndex

Call Example

Send MoveDynamicObjectToIndex sDynamicObjectId sParentId iInsertIndex

Description

Moves a dynamic object to a specific index in a new parent's list of child objects. This requires the object that is being moved to already exist inside the dynamic object container. Furthermore, the moved object inherits the parent structure of the object it is moved to.

Sample

This sample creates dynamic objects oGroup1 and oGroup2. The oGroup1 object has child object oForm1; oGroup2 has oForm2 and oForm3. It then moves oForm3 from oGroup2 to oGroup1 and places oForm3 at index 0, pushing oForm1 to index 1 (second element in the list of chindren of oGroup1).

Get CreateDynamicObject of oContainer (RefClass(cWebGroup)) "oGroup1" "" to hoGroup1
Send InitDynamicProp of hoGroup1 "piColumnCount" 8
Get CreateDynamicObject of oContainer (RefClass(cWebForm)) "oForm1" "oGroup1" to hoForm1
Send InitDynamicProp of hoForm1 "piColumnSpan" 8 
Send InitDynamicProp of hoForm1 "psLabel" "My form1"

Get CreateDynamicObject of oContainer (RefClass(cWebGroup)) "oGroup2" "" to hoGroup2
Send InitDynamicProp of hoGroup2 "piColumnCount" 8
Get CreateDynamicObject of oContainer (RefClass(cWebForm)) "oForm2" "oGroup2" to hoForm2
Send InitDynamicProp of hoForm2 "piColumnSpan" 8 
Send InitDynamicProp of hoForm2 "psLabel" "My form2"
Get CreateDynamicObject of oContainer (RefClass(cWebForm)) "oForm3" "oGroup2" to hoForm3
Send InitDynamicProp of hoForm3 "piColumnSpan" 8 
Send InitDynamicProp of hoForm3 "psLabel" "My form3"

Send MoveDynamicObjectToIndex of oContainer "oForm3"  "oGroup1" 0