cancel
Showing results for 
Search instead for 
Did you mean: 

Outbound plug of a view_container_uielement

Former Member
0 Kudos

Dear Developers,

Is there any kind of "outbound plug" for a view_container_uielement ?

Actually I would like to detect when a view contained in a view_container_uielement has reached an outbound plug. This would then me allow to jump out of the view containing the container.

Does it sound reasonable? Possible?

Sincerely,

Olivier MATT

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Olivier,

I had a similar problem with prepare_dynamic_navigation once that though i called the method correctly, th old view was still being displayed. Can you check that you create a new outbound plug for each view or not? (do you have a different name in front of 'source_plug_name' for every view??)

After this, use if_wd_view_controller->fire_plug( <plug_name> ) to navigate. You can have the plug name as a string so that u don't have to have an if..else... everytime.

Hope this is what you were looking for.

Regards,

Neha

Former Member
0 Kudos

Hi Neha,

There is no outbound plug for the view which is contained inside the view_container_UIElement.

This view raises an event which is handled by the upperview, which then fire its outbound plug (which is statically defined).

I then enter the WDDOINIT method of the "outbound" view but the view is not refreshed.

Strange behavior...

Regards,

Olivier MATT

Former Member
0 Kudos

Hi Olivier.

So why do you use the prepare_dynamic_navigation at this point? The source and the target are defined at runtime, aren't they?

When you use prepare dynamic navigation the system creates the connection link (outbound / inbound ) for you. Then you should fire the outbound received by the plug as neha mentioned.

Could you also paste the code you use for navigation?

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

The prepare_dynamic_navigation is made to put any view at runtime in the <i>view_container_ui_element</i>.

Here is my schema:

<b>V1 -


outboung plug -


> V3

|---- VIEW_CONTAINER_UI_ELEMENT

####|---- V2 ( this V2 is determined at runtime)</b>

Now V2 raises an event which is caught by V1. V1 fires its outboung plug to V3.

V3 WDDOINIT is loaded but the content of my browser is not refreshed, and I am still in V1 (with V2 still displayed in the view_container_ui_element and the other UIElements).

Here is the coding for th embedding of V2 in the VIEW_CONTAINER_UI_ELEMENT ( sorry but the names used in the coding do not match with the previous definitions in the schema ).


data: l_ref_cmp_usage type ref to if_wd_component_usage,
      L_VIEW_CONTROLLER_API type ref to IF_WD_VIEW_CONTROLLER.

* we get the taskselection component
l_ref_cmp_usage =   wd_This->wd_CpUse_Usage_Taskselection( ).

* we embbed the component in the viewcontainerUIelement

L_VIEW_CONTROLLER_API = WD_THIS->WD_GET_API( ).

L_VIEW_CONTROLLER_API->PREPARE_DYNAMIC_NAVIGATION(
              source_window_name          = 'MAINWINDOW'
              source_vusage_name          = 'TASKSELECTIONVIEW_USAGE_1'
              source_plug_name            = 'PLUGOUT'
              target_component_name       = 'ZWD_TASKSELECTIONCOMP'
              target_component_usage      = 'USAGE_TASKSELECTION'
              target_view_name            = 'SELECTIONWINDOW'
              target_plug_name            = 'DEFAULT'
              target_embedding_position   = 'TASKSELECTIONVIEW/VIEW_CONTAINER_UIELEMENT' ).

Again, I do not want to fire the V2 outbound plug but V1 outboung plug in order to jump to V3.

So if you have, as usual a great idea Sascha, let me know

Regards,

Olivier MATT

Message was edited by:

Olivier Matt

Message was edited by:

Olivier Matt

Former Member
0 Kudos

Hi Olivier.

What is the name of the statically defined outbound plug you use to navigate from

v1 to v3. Is it the same you use in the method call to embedd v2 in v1

('PLUGOUT')?

You should know that each time you call prepare_dynamic_navigation the created

link is stored internally by the system with the name of the source_plug. If you

would call prepare_dynamic_navigation three times with source_plug 'PLUGOUT'

and afterwards fire the 'PLUGOUT' plug the navigation is triggered three times

So if the statically defined plug is also called 'PLUGOUT' it could be that you

trigger multiples navigations.

This way the navigation from v1 to v3 would be called first and afterwards the

dynamic navigation from v1 to v2 again, so that you still see view2. You could also

set a break point in v2 (not wddoinit but any inbound plug handler, maybe DEFAULT)

to prove this.

Hope this is understandable

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

The name of the plug from v1 to v3 is PLUGOUT.

The name of the outbound plug of V2 is NODESTPLUG.

The prepare_dynamic_navigation call is performed only once ( in the WDDOINIT of V1).

I tried to set breakpoints in the HANDLEPLUGIN of various views but they are never reached ... Maybe something is wrong.

Anyway, I have the following sequence in the debugger (BP stands for breakpoint):

<b>WDDOINIT BP (v1)</b> -> WDDOMODIYVIEW BP(v1) -> ... -> (now we jump out of v1) <b>WDDOINIT BP (v3)</b> -> WDDOMODIFYVIEW BP (v1)

Is this WDDOMODIFYVIEW call in V1 normal? Do you know anyway to check that I am now inside v2 ? (any other way than a break point in the plugin handler).

Regards,

Olivier MATT

Message was edited by:

Olivier Matt

Former Member
0 Kudos

Thats a strange thing.

But seems that you use the name twice. Once for the static defined from v1 to v3

and then in the prepare_dynamic_navigation for dynamically embedding v2. Rite?

Do you call the fire plug method directly after the prepare_:... method? Then just try the following:


data:
        lv_outplug   type string.
        
        lv_outplug = 'TEST'.

L_VIEW_CONTROLLER_API->PREPARE_DYNAMIC_NAVIGATION(
              source_window_name          = 'MAINWINDOW'
              source_vusage_name          = 'TASKSELECTIONVIEW_USAGE_1'
              source_plug_name            = lv_outplug
              target_component_name       = 'ZWD_TASKSELECTIONCOMP'
              target_component_usage      = 'USAGE_TASKSELECTION'
              target_view_name            = 'SELECTIONWINDOW'
              target_plug_name            = 'DEFAULT'
              target_embedding_position   = 'TASKSELECTIONVIEW/VIEW_CONTAINER_UIELEMENT' ).

l_view_controller_api->fire_plug(
     exporting
       plug_name = lv_outplug
     ).

Hope I am on the right track

Cheers,

Sascha

Former Member
0 Kudos

Hi,

I solved my problem. I changed the name of the OUTPLUG of V2 to NODESTPLUG.

Previously V2 and V1 had the same name for outbound plugs.

I then changed the coding in the PREPARE_DYNAMIC_NAVIGATION and everything is working correctly now.

So... never use the same outbound plug names !

Regards,

Olivier MATT

Former Member
0 Kudos

Hi,

as I said, the problem was that the name you use in the prepare_dynamic_navigation and as static outboundplug were the same.

In this case both navigation were triggered

Please close this thread by marking as answered.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

I am not sure if both navigations were triggered but something went definitely wrong.

If you are ever in Walldorf Sascha let me know, I will reward you with a beer ( since you have so many points already !).

Sincerely,

Olivier MATT

Former Member
0 Kudos

Hey Olivier.

So you are located in Walldorf at SAP? Maybe I will take some course there someday. Then I will definitely come back to this invitation.

Cheers,

Sascha

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Olivier,

if the plug from V1 to V3 is 'PLUGOUT' then why do u have it in the prepare_dynamic_navigation as source_plug_name? Here, you are wrongly creating a dynamic link from V1 to V2 using 'PLUGOUT'. You should have a different plug name for embedding V2 in V1 in your method call. (This plug need not be statically defined, you can declare it in the program itself).

Regards,

Neha

former_member215843
Active Participant
0 Kudos

Hi Olivier,

There is no need to detect this. It is possible (and the framework is explicitely designed to support this) to create a navigation link from outbound plug of the inner view to an inbound plug of the view replacing the outer view.

Ciao, Regina

Former Member
0 Kudos

Hi Regina,

Correct me if I misunderstood your sentence.

If I create a link from my innerview to another view (called A), then I will not go out of my view containing the view_container. The view container will just replace the innerview by a new one.

What I need is to exit the view containing the container...

Regards,

Olivier MATT

former_member215843
Active Participant
0 Kudos

Hi Olivier,

Let's assume you have a window W with 2 views, V1 and V2, and inside of V1 there is another view VA. If you leave VA, you want to display V2 instead of V1. Right?

The hierarchy of the window should look like this:


W
-V1
  -Area1
    -VA
      - OUT_VA
- V2
  - IN_V2

Then drag a navigation link from V1Area1VAOUT_VA to V2IN_V2 and fire OUT_VA.

Ciao, Regina

Former Member
0 Kudos

Hi Regina,

If I create a link from VA-OUT_VA to V2-IN_V2 then I will get the following tree:

W

\-V1

\-Area1

\-v2

I want to escape V1 completely...

Former Member
0 Kudos

Hi Regina,

Probably there is another way to acheive the same.

Could it be possible to send an "event" from the innerview to the view containing the container (the outerview) ?

So this innerview would tell the outerview it is ready to call the outerviews outbound plug.

Regards,

Olivier MATT

former_member215843
Active Participant
0 Kudos

Hi Olivier,

You should place V2 in your window at the same position as V1, not at the same position as the inner view!

Regina

Former Member
0 Kudos

Hi Regina,

I understood this. But I need something like an event from the container view to the upperview which would indicate that the upperview should go to V2.

How can I acheive this?

Regards,

Olivier MATT

Former Member
0 Kudos

Hi Olivier.

Just create an event in component controller of the inner view. Then if you want to

navigate from upperview to view2 fire the event in a method of the view controller of

the inner view. You can do this by using the wizard. You

will find a fire_... method in the used component

controller which has to be called.

Create an eventhandler for the event in the upperview and in this handler fire the

plug that navigates to view2.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

Hi Sascha,

You answered exactly what I need

But I am not sure where the event should be defined (inside the contained view or upperview ?).

1. My wizard does not show any kind of fire method for the event I created.... which is quite strange. Can I call manually (so what is the name convention?).

2. Is the following sentence correct ?

An event which is not handled in the local component is can be handled by the component which is embedding one of its windows ? Thus should I define this event two times ?

Sincerely,

Olivier MATT

Former Member
0 Kudos

Hi Olivier.

You should define the event on the component controller level of the component

which contains the view you use as inner view. Then you have to define the usage

of the component controller at the properties tab of this view. When you use the

wizard just click on call method of used controller -> select the component

controller -> use F4 and you will see all methods of the component controller ...

there should be the fire method.

You also can receive this event from a component usage. you have to define the

component usage on the properties tab of the view which embedds the above view

(in ur case). then you can create an event handler in the view controller of the view

by using F4 and selecting the event from the component usage on the event

column in the methods tab.

hope this helps,

Sascha

Former Member
0 Kudos

Hi Sacha,

So I created an event in the contained view which is caught by the handler of the upperview.

This handler then fires the outbound plug.

Everything at this point seems to be working, the wd4a runtime navigates to the new view ( I checked it with a break point in the WDDOINIT ).

But what is displayed in my browser is not the new view but the old one. It looks like there is no refresh...

Have I discovered a bug ? Or did I do something wrong ?

Sincerely,

Olivier MATT

PS: the view contained in the container is set dynamically with L_VIEW_CONTROLLER_API->PREPARE_DYNAMIC_NAVIGATION( ... )