I am trying to use frontcall with cbpaste to insert a value into text in a textedit, without luck. Can anyone help find a way around it please?
I want the users to select the text to insert from a function that produces a popup menu and I think it is this going off to another function that effectively loses focus from the field I'm in, even once I've returned back to the action block.
THIS WORKS (never leaving the on action block):
ON ACTION myaction
IF ( INFIELD(myfield) )
THEN
CALL ui.Interface.frontCall("standard","cbset",["My Text"],[lv_result])
CALL ui.Interface.frontCall("standard","cbpaste",[],[lv_result])
END IF
THIS DOES NOT WORK:
ON ACTION myaction
IF ( INFIELD(myfield) )
THEN
CALL my_menu() RETURNING lv_string
CALL ui.Interface.frontCall("standard","cbset",[lv_string],[lv_result])
CALL ui.Interface.frontCall("standard","cbpaste",[],[lv_result])
END IF
Although, then right clicking and selected Paste will then insert the text as I want it to.
I've also tried (and this doesn't work either, though not that useful anyway):
ON ACTION myaction
IF ( INFIELD(myfield) )
THEN
CALL my_menu() RETURNING lv_string
NEXT FIELD CURRENT
END IF
BEFORE FIELD myfield
IF ( lv_string IS NOT NULL )
THEN
CALL ui.Interface.frontCall("standard","cbset",[lv_string],[lv_result])
CALL ui.Interface.frontCall("standard","cbpaste",[],[lv_result])
LET lv_string = NULL
END IF