cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro popup using one view

former_member213263
Participant
0 Kudos

hi,

My requirement is to use a popup for confirmation for the saving the data in the table with the button OK and Cancel and i want to use just one view for manual entry in the input fields. Is there any way out to use only one view and develop an web dynpro application.

Help me..

Regards

ankit

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member194152
Contributor
0 Kudos
former_member213263
Participant
0 Kudos

hi gagan,

thanks for your prompt reply,

i have done accordingly but on clicking on the buttons its not triggering the action SAVE to the database table.

Code written for pop up is:

   DATA lo_window_manager TYPE REF TO if_wd_window_manager.

   DATA lo_api_component  TYPE REF TO if_wd_component.

   DATA lo_window         TYPE REF TO if_wd_window.

   lo_api_component  = wd_comp_controller->wd_get_api( ).

   lo_window_manager = lo_api_component->get_window_manager( ).

   data: lt_string type table of string,

         ls_string like line of lt_string.

   ls_string = 'Do You Want To SAVE?'.

   insert ls_string into table lt_string.

   CALL METHOD lo_window_manager->create_popup_to_confirm

     EXPORTING

       text                 = lt_string

       button_kind          = 3

     RECEIVING

       RESULT               = lo_window.

and the code for the action on the buttons of popup is:

data:

     lo_api         type ref to if_wd_view_controller,

     lo_window_ctlr type ref to if_wd_window_controller,

     lo_popup       type ref to if_wd_window.

  

    lo_api         = wd_this->wd_get_api( ).

   lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).

 

if lo_window_ctlr is bound.

     lo_popup       = lo_window_ctlr->get_window( ).

    

if lo_popup is bound.

     

lo_popup->subscribe_to_button_event(

              button   = if_wd_window=>co_button_ok

              action_name = 'SAVE_INPUT'

              action_view = lo_api ).

 

lo_popup->subscribe_to_button_event(

              button   = if_wd_window=>co_button_cancel

              action_name = 'EXIT'

              action_view = lo_api ).

     endif.

   endif.

and when i used the debugger it doesn't enter into the "if lo_popup is bound" ie the values are not going in the database.

former_member194152
Contributor
0 Kudos

everything about the popup is encoded in application WDR_TEST_POPUP_01, check DLG_TEXT view for your reference.

former_member213263
Participant
0 Kudos

Gagan,

I dint get it friend can you plz elaborate it...

amy_king
Active Contributor
0 Kudos

Hi Ankit,

In your system, take a look at example web dynpro component, WDR_TEST_POPUP_TO_CONFIRM.

Cheers,

Amy

former_member213263
Participant
0 Kudos

hi Amy,

thanks for the help.

I am using "create_popup_to_confirm" method to create a popup and then using default button and putting action on it but its not triggering the action SAVE.

Is there any other thing to do.

regards

ankit

amy_king
Active Contributor
0 Kudos

Hi Ankit,

In the example component WDR_TEST_POPUP_TO_CONFIRM, take a look at View MAIN method onactiondisplay_popup to see how that application handles the call to method create_popup_to_confirm and how it handles calls to method subscribe_to_button_event.

The method onactiondisplay_popup receives an object from the call to create_popup_to_confirm and stores it in view attribute wd_this->popup. It is this object that is used in the button event subscriptions. If you use this same approach I think you'll find a solution.

I believe the problem you are having is that the popup you create with create_popup_to_confirm and the window you read with lo_window_ctlr->get_window are not the same object.

Cheers,

Amy

former_member213263
Participant
0 Kudos

hi Amy,

thanks again, I'll do the things accordingly and let you know.

regards

Ankit jain