Skip to Content

Dynamically change default view for popup window

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 17, 2008 at 03:14 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.