Question Create Triggers for objects

jmac13

Member
Hi All,

I'm using open edge 10.2b, my questions is about creating triggers for objects e.g. buttons browses on the fly.

I've got the below code that creates a value-changed trigger for each column in a browse. This resides in the main block. but want if I want to reuse my browse and add new columns from another table how can create these triggers again? why does it have to reside in the main block is this because this is where the code looks for triggers? how would I go about creating them again after the main block has run?

Code:
    do intCount = 1 to iphanFilterBrowse:num-columns:           
                 
        assign hanCol = iphanFilterBrowse:first-column.         
                   
        do while hanCol <> ?:           
            if hanCol:name = 'logSelected' then do:     
           
                on 'VALUE-CHANGED':U of hanCol           
                    do:         
                        define variable hanBuffer as handle no-undo.           
                                 
                        assign logRefresh                                        = true         
                              hanBuffer                                          = iphanFilterBrowse:query:get-buffer-handle         
                              hanBuffer:buffer-field("logSelected"):buffer-value = self:screen-value. 
                               
                        apply 'choose' to iphanSortButton.                         
                    end.         
            end.                     
                 
            assign hanCol = hanCol:next-column.           
        end.                   
    end.               
end.
 
Top