I am trying to create a cWebCombo object dynamically:
Code:
Object oContainerForCombo is a cWebDynamicObjectContainer
Set piColumnCount to 12
Procedure OnLoad
Handle hoControl
String[] aParams
tWebValueTree tData
Forward Send OnLoad
Get CreateDynamicObject (RefClass(cWebCombo)) "Comboleinen" "" to hoControl
Send InitDynamicProp of hoControl "psLabel" "Select your option"
Send InitDynamicProp of hoControl "peLabelPosition" lpTop
Send InitDynamicProp of hoControl "piColumnSpan" 0
Send FillFromDDO of hoControl // Resets
Send AddComboItem of hoControl "1" "Evil 1"
Send AddComboItem of hoControl "2" "Evil 2"
// Send paComboItems to the client....
Get ComboData of hoControl to tData
Send ClientAction of hoControl "fill" aParams tData
Send Activate // The solution is to move this 3 lines up. But read my own answer below this message
End_Procedure
End_Object
and while the combo is created it is not initialised. Is it easy to see what I am missing?
The above code can be pasted directly into DemoDynamicObjects.wo of the WebOrder sample. It must be pasted immediately after the cWebDynamicObjectContainer object already in there.
-Sture