I have 3 WD4A applications that run in a new window when launched from the portal. I'm trying to stop the user closing the window and losing data.
In the component controller doInit method I set work protection to on and set the Christina Aguilara flag (isDirty) to TRUE:
DATA LO_API_COMPONENT TYPE REF TO IF_WD_COMPONENT.
DATA LO_PORTAL_MANAGER TYPE REF TO IF_WD_PORTAL_INTEGRATION.
LO_API_COMPONENT = WD_THIS->WD_GET_API( ).
LO_PORTAL_MANAGER = LO_API_COMPONENT->GET_PORTAL_MANAGER( ).
CALL METHOD lo_portal_manager->SET_WORK_PROTECT_MODE
MODE = 'BOTH'
call method LO_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG
DIRTY_FLAG = abap_true
I thought that if the user then pressed close (X) it would prompt the user as per:
Can anyone help?