Advanced Dynamic Objects
Lesson 4 - Step 3: Creation phase
The purpose the Creation Phase is to create all of the initial dynamic objects. The CreateDynamicObject function is called multiple times to achieve this.
Demonstration
- For this sample application, all of the dynamic objects are to show with the page is loaded. The construction is defined inside the container’s OnLoad procedure.
- The code inside this function is similar to what was shown inside the OnClick procedure of the cAddButton class.
- First, retrieve the number of address lines that are currently present while making sure to give the new objects unique names
- Next, the CreateDynamicObject is used three times:
- Create a cWebForm object: represents the address line present when the container loads
- Create the button to adds a new row
- Create the button to remove the last row
- Dynamic properties, that are mostly related to positioning, are set for each of the three new dynamic objects