If you have more than one column enabled in you browse you will need to use the following instead:
FUNCTION is_browse_column RETURNS LOGICAL
( lh_browse AS WIDGET-HANDLE,
lh_column AS WIDGET-HANDLE ) :
DEFINE VARIABLE ll_ret AS LOGICAL NO-UNDO INITIAL FALSE.
DEFINE VARIABLE li_i AS INTEGER NO-UNDO.
DEFINE VARIABLE lh_w AS WIDGET NO-UNDO.
DO li_i = 1 TO lh_browse:NUM-COLUMNS:
ASSIGN
lh_w = lh_browse:GET-BROWSE-COLUMN( li_i )
.
IF lh_w = lh_column THEN
DO:
ASSIGN
ll_ret = TRUE.
LEAVE.
END.
END.
RETURN ll_ret. /* Function return value. */
END FUNCTION.
DEFINE VARIABLE lh_wig AS WIDGET-HANDLE NO-UNDO.
DEFINE VARIABLE lh_frm AS WIDGET-HANDLE NO-UNDO.
ASSIGN
lh_wig = LAST-EVENT:WIDGET-ENTER
.
IF is_browse_column( BROWSE {&BROWSE-NAME}:HANDLE, lh_wig ) THEN
DO:
MESSAGE "Browser".
END.
KarinV said:
It already is NO-ASSIGN. The problem is that there is one procedure (for all updateable browsers). The row-leave trigger validates and stores the data.
Nothing wrong with that, except that the row-leave trigger is fired at unexpected moments. Is there a way to tell if the row-leave is the result of an action in the browser or a result from simply leaving and returning to the window?