Changing Field Value Is Not Triggering Changed Event
Posted: Sat Apr 29, 2017 2:04 am
I have a field that uses a prompter popup panel to allow a user to lookup a value. When a value is selected I set the field to the value. The problem is that the change event does not seem to be firing so the save button never gets enabled.
Here is the field and popup selection
The list of panel fields
That is populated by
The field is in the collection and I listen for the changed event to enable to save button.
The problem is that the #PanelFields<>.Changed event is never getting invoked. I thought I remembered having to set the modified property on the field after it was changed programmaticaly because the changed event only fires when a user interacts with it.
But now, even with the Modified property set, it still does not fire. Is there anyway to get that event to fire?
Here is the field and popup selection
Code: Select all
evtroutine handling(#CMDBC.PrompterActivate)
#DUNSPopup.Load( #wk_CountryCode )
#DUNSPopup.ShowPopup context(#CMDBC) placement(Center)
endroutine
evtroutine handling(#DUNSPopup.Selected) code(#code) description(#description)
#CMDBC := #code
#CMDBC.Modified := True
#DUNSPopup.ClosePopup
endroutine
Code: Select all
define_com class(#PRIM_KCOL<#PRIM_EVP #STD_STRNG>) name(#PanelFields) style(Collection)
Code: Select all
mthroutine name(CollectEditableControls)
define_map for(*INPUT) class(#PRIM_PCOL<#PRIM_CTRL>) name(#controls) pass(*BY_REFERENCE)
define_com class(#PRIM_EVP) name(#tempField) reference(*DYNAMIC)
define_com class(#PRIM_CPST) name(#tempContainer) reference(*DYNAMIC)
for each(#control) in(#controls)
if_ref com(#control) is(*INSTANCE_OF #PRIM_EVP)
#tempField <= #control *As #PRIM_EVP
#avFrameworkManager.avRecordTraceAValue event("Adding Control To Panel Fields") component(#COM_OWNER) avalue(#tempField.Name)
#PanelFields<#tempField.Name> <= #tempField
else
if_ref com(#control) is(*INSTANCE_OF #PRIM_CPST)
#tempContainer <= #control *As #PRIM_CPST
#COM_OWNER.CollectEditableControls( #tempContainer.ComponentControls )
endif
endif
endfor
endroutine
Code: Select all
evtroutine handling(#PanelFields<>.Changed)
#SaveButton.Enabled := True
#SaveCredit := True
endroutine
But now, even with the Modified property set, it still does not fire. Is there anyway to get that event to fire?