We have a keydownhandler on our form to detect a return key and invoke save changes.
It does this by finding the first container of the activecontrol that has the Consultingwerk.SmartComponents.Interfaces.ISmartTableIOTarget interface , see code snippet at the end of this post.
it then invokes SaveChanges on the oHasSave object.
This does not work if the viewer containing the activecontrol is a GroupAssign Target .
In that case the savechanges stops on line 3724 of the SmartViewerControl
IF VALID-OBJECT(oSmartGroupAssignSource) THEN
RETURN.
Is this the way it's supposed to work ?
I guess the return is there to prevent an endless recursion when the savechanges is called by the groupassign source, but should this also be the case when called directly on the group assign target ?
/* get extra info about the active control */
oContainer = this-object . // the form control
FindControls:
do while valid-object (oContainer):
oControl = oContainer:ActiveControl .
if valid-object (oControl) and type-of (oControl, System.Windows.Forms.ContainerControl)
then oContainer = cast (oControl, System.Windows.Forms.ContainerControl) .
else leave FindControls.
..
/* get extra info for tableIO */
if type-of (oControl, Consultingwerk.SmartComponents.Interfaces.ISmartTableIOTarget)
then oHasSave = cast (oControl, Consultingwerk.SmartComponents.Interfaces.ISmartTableIOTarget).
end.
Last modified on 04 Jan 2019 15:01 by Carl Verbiest