cancel
Showing results for 
Search instead for 
Did you mean: 

popup to confirm when closing browser window?

johnson_george2
Explorer
0 Kudos

Hi

I want to display popup confirm window when closing browser window, "changes will be lost" yes or no.

For this I searched forums got some idea, about "WORK PROTECT MODE".

This will work only when the application is running from portal.

But my application is Registration of Suppliers (ROS), which runs directly runs from an URL??? any help

Thanks,

Johnson George

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member213957
Participant
0 Kudos

Hi Johnson,

If you want to display standard confirm popup by framework itself and this provided by sap, i.e; implement the method is_dirty of interface if_fpm_work_protection and pass the values true/false.

   or  

second way in wd,

you can create your own confirm popup using implement the method needs_confirmation of if_fpm_ui_building_block in webdynpro component and also you can pass the standards message using cl_fpm_confirmation_request=>go_data_loss.

similarly in fpm,

FPM provided separate interfaces for all guibb's like if_fpm_guibb_*****_ext(form,list,powl,search....etc)and

should implement method name is needs_confirmation and also you can pass the standards message using cl_fpm_confirmation_request=>go_data_loss. 

Note: event  for close the window--fpm_close            

                    for close the popup --fpm_dialog_close     "" based on these events design the logic.

Former Member
0 Kudos

Hello Johnson,

Refer following http://scn.sap.com/thread/3247164. Or try to implement "IF_FPM_WORK_PROTECTION" interface in your WDP component and the set "Dirty_flag = abap_true".This will open a confirmation popup while closing the browser window.

Thanks

Katrice

johnson_george2
Explorer
0 Kudos

Hi Katrice,

I read the entire thread ..looks  relevent.

Just to let you know....I am closing the application from the browser (In your case there was a close button)

And how are you seting the 'Dirty_Flag'.

As per the thread...

I have implemented the IF_FPM_WORK_PROTECTION interface.

writtten the code  ..

in the PROCESS_EVENT method of the component controller. 

lo_fpm is class reference of IF_FPM.

   CASE io_event->mv_event_id.

     WHEN 'FPM_CLOSE_DIALOG'.

    lo_fpm->raise_event_by_id( iv_event_id = cl_fpm_event=>gc_event_close ).

    ENDCASE.

And

Implement this code in NEEDS_CONFIRMATION Method of the component controller.

METHOD needs_confirmation.

   CLEAR eo_confirmation_request.

   CASE io_event->mv_event_id.

     WHEN 'FPM_CLOSE'. "

            eo_confirmation_request = cl_fpm_confirmation_request=>go_data_loss.

   ENDCASE.

ENDMETHOD.

But I am not getting the popup .

Thanks,

Johnson

Former Member
0 Kudos

Hello Johnson,

Refer following thread : http://scn.sap.com/thread/1503036

Thanks

Katrice

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Refer http://scn.sap.com/docs/DOC-42997. I guess this will help to satisfy your requirment.

Regards,

Chandra

nagarjun_kalletla
Participant
0 Kudos

Above thread will resolve your Issue.But  You should create a Model pop up in the component . Instead of closing the window  in CLOSE_WINDOW .

Creating model pop up you can use the following link

http://saptechnical.com/Tutorials/WebDynproABAP/Modalbox/page3.htm