Results 1 to 2 of 2

Thread: cWebDynamicObjectContainer - how to initilalize a cWebCombo?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Copenhagen, Denmark
    Posts
    2,006

    Default cWebDynamicObjectContainer - how to initilalize a cWebCombo?

    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
    Last edited by Sture; 14-Feb-2021 at 01:01 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •