cancel
Showing results for 
Search instead for 
Did you mean: 

POPUP WINDOW

Former Member
0 Kudos

I'm calling another window like this...


  DATA: CONTEXT_NODE TYPE REF TO IF_WD_CONTEXT_NODE.

  DATA: LR_POPUP TYPE REF TO IF_WD_WINDOW,
        LR_VIEW_CONTROLLER TYPE REF TO IF_WD_VIEW_CONTROLLER.

  DATA: LR_API_COMP_CONTROLLER TYPE REF TO IF_WD_COMPONENT,
        LR_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.

  LR_API_COMP_CONTROLLER = WD_THIS->WD_GET_API( ).
  LR_WINDOW_MANAGER =
             LR_API_COMP_CONTROLLER->GET_WINDOW_MANAGER( ).

  LR_POPUP = LR_WINDOW_MANAGER->CREATE_WINDOW(
  MODAL               = ABAP_TRUE
  WINDOW_NAME         = 'WND_MATRIX'
       "Name of the window created in step 2
  TITLE               = 'Please enter all information'
  CLOSE_BUTTON        = ABAP_FALSE
  BUTTON_KIND         = IF_WD_WINDOW=>CO_BUTTONS_YESNO
  MESSAGE_TYPE        = IF_WD_WINDOW=>CO_MSG_TYPE_ERROR
  CLOSE_IN_ANY_CASE   = ABAP_TRUE
*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
  ).

* Adds an action to the popup screen buttons
* lr_view_controller = wd_this->wd_get_api( ).

* lr_popup->subscribe_to_button_event(
* button = if_wd_window=>co_button_ok
* button_text = 'Yes'
* action_name = 'SUBMIT'
* action_view = lr_view_controller ).
  LR_POPUP->SET_WINDOW_SIZE(
      WIDTH  = '800'
      HEIGHT = '600'
         ).
  LR_POPUP->OPEN( ).

i'd like the window to fit to the main window... 'Full screen'

how can i do thazt ?

Accepted Solutions (0)

Answers (4)

Answers (4)

OttoGold
Active Contributor
0 Kudos

Hello, I would like to resize my window/ view. I have very similar coding to the one above, but that does not work for me. I am running in circles because all the threads about the topic are linked together and I didn´t recognize the answer in any of the threads.


  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( ).

  lo_window = lo_window_manager->create_window(
    window_name          = 'W_POPUP_FORM'
    message_display_mode = if_wd_window=>co_msg_display_mode_selected
    button_kind          = if_wd_window=>co_buttons_ok
    message_type         = if_wd_window=>co_msg_type_none
    default_button       = if_wd_window=>co_button_ok ).

  lo_window->set_window_size(
        width  = '900px'
        height = '700px'
           ).

  lo_window->open( ).

I see no points assigned, question answered but none of the answers is marked "solved the problem".

So could anybody clarify one more time? This set_window_size is not supposed to work? I am supposed to resize the RootUIElementContainer and that is not what this code is doing? Then how I am suppoosed to do it?

I have never had a reason to use this and now feel like I am asking something dull, but could anybody clarify on¨ce and for all?

And emphasize for a slow man like me, how to resize the RootUIElementContainer and where? Would be just great, thank you,

regards Otto

Former Member
0 Kudos

Hi

use

LR_POPUP->CLOSE( ). instead of LR_POPUP->OPEN( ).

Window will be closed..rest of the code is same

Best Regards

Ravi Golla

arjun_thakur
Active Contributor
0 Kudos

Hi Stephan,

I don't think SET_WINDOW_SIZE method works properly in setting the size of pop up window. You should try to set the height and width of the ROOTUIELEMENTCONTAINER of the pop up view to get the required size.

Regards

Arjun

Former Member
0 Kudos

How can I handle the closing of the window ?

arjun_thakur
Active Contributor
0 Kudos

Hi,

By default ok button is created, by clicking on it the window closes. Or you can create a button in the pop up view and use the following code in the ONACTION method of that button to close the pop up window:


method ONACTIONACTONOK .
      data:
            l_api         type ref to if_wd_view_controller,
            l_window_ctlr type ref to if_wd_window_controller,
            l_popup       type ref to if_wd_window.
            l_api         = wd_this->wd_get_api( ).
            l_window_ctlr = l_api->get_embedding_window_ctlr( ).
            if l_window_ctlr is bound.
            l_popup       = l_window_ctlr->get_window( ).
            l_popup->close( 'l_popup' ). 
            endif.

endmethod.

I hope it helps,

Regards

Arjun

Former Member
0 Kudos

get the reference of popup window and there is close method to close it.

Best regards,

Rohit

Former Member
0 Kudos

Stephan,

How to handle closing the popup?

Contrary to what you were told there is no need to store the reference to the popup and close it explicitly. That is because the popup you created has close_in_any_case set to true.

Only when you need to keep the popup open even after the user clicks YES / NO buttons you would

need to do store the poup and close it programmatically based on some conditions:

user clicks YES -> valid data ?

if true - do something and close popup - call method close

if false - do nothing (or issue error messages). Popup stays open

Regards,

George

former_member40425
Contributor
0 Kudos

Hi,

Change the height and width of rootuielementcontainer of view which is embedded in the pop up window.

Rgrds,

Rohit