cancel
Showing results for 
Search instead for 
Did you mean: 

Display different views in MAIN view on click action

Former Member
0 Kudos

Hi,

I am working on requirement to design the UI using ABAP webdynpro, where in main view has left side with group UI element under it have tray UI element which compose of link to URL UI element, & on right side has containerUIelement , for each click action on left side panel should display the cotent of views in same view i.e. MAIN window itself.

I have refered the demo application WDR_TEST_EVENTS which fits to my requirement but i am not able to get different view on click action in MAIN view display ,which is perfectly shown in above demo program.

in my application Main view is design as similar to above demo application, can some one please guide me to achieve this functionality or any working simple example will do or guide me where i can get the help on such requirement.

Thanks,

Digamber.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks all,

problem is resolve, in main window create the inbound of view under container , this is done by embeding the inbound of view & create the navigation link for each of views define in you application which you want to display in main view of the application.

Thanks,

Digamber.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Navigation plugs are the "normal" way of doing this (so you are certainly on the right path). There is also a dynamic navigation option if you have a fast number of embedded views. You can also use the API do_dynamic_navigation of the view controller. This API doesn't require any navigation links to be created at design time.

data:
    l_api_main type ref to if_wd_view_controller. 
    l_api_main = wd_this->wd_get_api( ).
    try.
        l_api_main->do_dynamic_navigation(
            source_window_name        = 'MAIN'
            source_vusage_name        = 'MAIN_VIEW_USAGE_1'
            source_plug_name          = source_plug_name
            target_view_name          = target_view_name
            target_plug_name          = 'DEFAULT'
            target_embedding_position = 'MAIN_VIEW/VIEW_CONTAINER').
        .
      catch cx_wd_runtime_repository .
        raise exception type cx_wdr_rt_exception.
    endtry.

Former Member
0 Kudos

Appriciate your quick respond Jason,

Yes, you correct , My MAIN view should alway been shown with change in container ( this is define in my application). on my left panel comprises of link to Url UI element & on click event i want to display the different view in container define on right side.

please guide me how to achieve this.

Former Member
0 Kudos

here is a quick way to do it maybe there are other ways but this also work.

Step 1:

Create a DATA ELEMENT CHAR 1 with X = YES and NULL = NO (I WILL NAME THIS Z_VISIBLE)

Step 2:

In your CONTEXT NODE create an ATTRIBUTE TYPE Z_VISIBLE (you can also call the attribute Z_VISIBLE_LINK1)

if you have 3 containers you can do Z_VISIBLE_LINK1, Z_VISIBLE_LINK2, Z_VISIBLE_LINK3, etc

Step 3:

In your MAIN VIEW you should have ALL YOUR CONTAINERS (for example transparent containers)

In the UI ATTRIBUTES go to the VISIBLE ATTRIBUTE and BIND the VISIBLE ATTRIBUTE to your ATTRIBUTE Z_VISIBLE_LINK1 of your CONTEXT node for your link #1 and for link 2 bind the Z_VISIBLE_LINK2, etc) " the one that you just created

now all your containers will be ON/OFF depending on your Z_VISIBLE ATTRIBUTE

Step 4:

For LINK1 (turn ON link 1 and OFF link 2 & 3:

In the ONACTION event (for the left side part of your view) you need to

SET_ATTRIBUTE ( name = 'Z_VISIBLE_LINK1' VALUE = 'X').

SET_ATTRIBUTE_NULL (name = 'Z_VISIBLE_LINK2).

SET_ATTRIBUTE_NULL (name = 'Z_VISIBLE_LINK3).

LINK2 (turn ON link 2 and OFF link 1 & 3:

do the same thing in the ONACTION and do:

SET_ATTRIBUTE ( name = 'Z_VISIBLE_LINK2 VALUE = 'X').

SET_ATTRIBUTE_NULL ( name = 'Z_VISIBLE_LINK1).

SET_ATTRIBUTE_NULL ( name = 'Z_VISIBLE_LINK3).

Same for all the other links.

PS. IF you dont want to show any other VIEWS then you need to take out the PLUGS, because the PLUGS are to navigate to additional VIEWS and your requirement is just to display different containers not VIEWS.

Hope this help!

Jason PV

Former Member
0 Kudos

Thanks for quick reply,

yes inbound & outbound plug are define but when i click on URL link it open another view without main view, which not my requirement.

is there any other setting or configuration require?

thanks,

digamber.

Former Member
0 Kudos

Can you explain your requirement?

You want to always show MAIN VIEW but change containers depending on the left side panel? I don't think I understand your requirement now.

thanks!

Jason PV

Former Member
0 Kudos

you need to create your outbound plugs and create a link with the inbound plugs at the window level.

is very simple task just need to follow the same example as WDR_TEST_EVENTS.

here is a link that explain how to navigate with the help of plugs!

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/308ebfe9-a07a-2c10-e494-9849d50ef...

thanks

Jason PV

Former Member
0 Kudos

Hi You have the Simeple working example

WDR_TEST_EVENTS .

I am not sure why it is not working for you. If the design golas are same then i would say, copy this component and make some changes and see if it works for you.

In the example MainView has many outbound plugs. based on the action (action to link ) appropriate plug is fired.

In the MainWindow plugs are connected.

Have you done the things as same as WDR_TEST_EVENTS ?