cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change default view for popup window

former_member189058
Active Contributor
0 Kudos

Hi,

I have one WDA component with two windows, one being the main window and other a popup window.

On the main window there ia one view with mutliple buttons.

One click of button1 I have to open popupView1 and on click of button2, popupView2.

I have created a window called popupwindow and assigned popupView1 to it.

Now popupView1 is the default view in popupwindow.

On click of button1, I open this window and the views shows as popup.

However, on click of button2 I have to show a different view. How can I do this using the same popupwindow.

One way that I can see is create as many windows as the number of popup views and assign one view to each window.

Another is to create one view and embed all other views as viewcontainers.

Depending on which button was clicked control the visibility of the view containers.

Is there any otherway?

Something like when opening the popup window, I can specify the view name to be shown.?

Regards,

Reema

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Reema

Instaed creating two popup windows,

Create only one and place the two views inside the same.

and create an attribute in the component controller set this attribute based on the button click.

in the WDDOMODIFYVIEW of the View1 check this attribute and navigate to View2.

Though View1 is the default view everytime, but you can see View1 or View2 in the window based on your attribute value.

OR

you can use the following code to dynamically embed a view in window and making it default view.

data: lr_window type ref to if_wd_window_controller.

data: lr_rr_window type ref to if_wd_rr_window.

data : lr_usage type ref to IF_WD_RR_VIEW_USAGE.

data str type string.

lr_window ?= wd_this->wd_get_api( ).

lr_rr_window = lr_window->GET_WINDOW_INFO( ).

lr_usage =

lr_rr_window->embed_view( USED_VIEW_NAME = 'V_VIEW2'

USED_COMPONENT_NAME = 'ZTEST123'

).

str = lr_usage->get_name( ).

lr_rr_window->SET_DEFAULT_ROOT_VUSAGE(

VIEW_USAGE_NAME = str ).

Abhi

Edited by: Abhimanyu Lagishetti on Jun 17, 2008 5:14 AM

Edited by: Abhimanyu Lagishetti on Jun 17, 2008 7:19 AM

Answers (0)