cancel
Showing results for 
Search instead for 
Did you mean: 

FPM: how to close a dialog by click button instead of "OK"/"Close"?

former_member644317
Discoverer
0 Kudos

     I have a dialog containing a free style webdynpro component, which will add a comments to some entity. "Add" button is part of the free style web dynpro component. Sometimes, after user inputs comments and clicks "Add" button , I want to the dialog close automatically.

     I tried following method, without success:

in handler of "Add" button, raise event "Note added".

  lo_fpm = cl_fpm_factory=>get_instance( ).
      lo_fpm->raise_event_by_id(
        EXPORTING
          iv_event_id   = gc_event_note_created
      ).

the statements are executed without any problem.

however, in feeder class of the page, I tried to catch "Note added" event, but this event could not be found in process event, it is not raised at all?? or becuase the page is in dialog mode?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try below code to close dialog.

   ****CLOSE FPM DIALOG BOX
  DATA: LO_FPM TYPE REF TO IF_FPM.
  LO_FPM = CL_FPM_FACTORY=>GET_INSTANCE( ).
  LO_FPM->RAISE_EVENT_BY_ID( 'FPM_CLOSE_DIALOG' ).

former_member644317
Discoverer
0 Kudos

Hi Hitesh,

     Thanks for your quick answer, following your instruction, the dialog can be closed.  However, I need to process the close event in parent page's feeder class: show a message saying "Note has been added" on UI. unfortunately, parent page's feeder class can't get the dialog closed event, or note_created event.

     how to notify parent page's feeder class of events happening in dialog page?

Former Member
0 Kudos

Hi Daveice,

Events in FPM framework run in event loop, So each and every event will pass through all the method of your feeder class whether you are raising it through the current GUIBB or from dialog box.

Put a break point in process_event method of your parent feeder and raise any of the event (close dialog box or note created event) it should trigger the method and you can catch it.

Thanks

Praveen Gupta

Answers (0)