cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation from view Container to an other

Former Member
0 Kudos

Hi,

i have a navigation Problem

this is my setup

View:     Main_Menue in there i got 2 TabStrips, and in each TabStrip i got included an ViewContainerUI Element so i go 2 of them.

The First Tab "X" the second Tab "Y"

X has the ViewContainer blah, and Y has the ViewContainer blubb in it.

in blah there is a View called bunny and in blubb there is a View called tiger

now i whant to navigate from bunny to tiger by clicking a button.

I try it by implemnting an outboundplug in the view bunny navigate to the inboundplug of Main_menue or tiger but with no reaction in it.

is there a tutorial for something like this?

ore what am i doing wrong?

krind regards

toby

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ok the Tab switching works...this was easy...but the view kitty did not open

i try this by 1 switchng tab as explaned above (worked)

and then navigate to view a) tiger or b) kitty with the use of outbound and inbound plug

but this did not work...not tiger view not kitty view...

so how can i show my kitty view ?

Former Member
0 Kudos

is it usual to put manny view in view container and then only switch the views by coding..maybe i have here a systematic construction problem...

i must say that i learnd web-dynpro by my self...

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Tobias Kübler wrote:

is it usual to put manny view in view container and then only switch the views by coding..

Yes, we can put as many views as we require in a view container ui element and control the the visibility of views as per requirement by programming.

Regards,

Rama

Former Member
0 Kudos

The view container is made for this purpose. Navigating will trigger the switch between the views. But here you have two tabs with a container each. You shouldn't have to navigate in fact because the tab will display the view it already contains.

The only reason you have to trigger a navigation there would be to dynamicaly change the view of target tab but there it's static.

Former Member
0 Kudos

To call kitty view in place of tiger, you need to use navigation plugs. Outbound in tiger and inbound in kitty, if you want to do this tiger->kitty on tab change then fire the plug on the "on_tab_select method" else write code on some action in tiger.

Former Member
0 Kudos

For the second scenario Chandra is right. Let just add that you should use the same view container for tiger and kitty also the same for bunny and mouse.

amy_king
Active Contributor
0 Kudos

Hi Tobias,

Yes, the usual approach for navigating between views is navigation links, that is, Inbound and Outbound Plugs.

Cheers,

Amy

Former Member
0 Kudos

Hi Sebastien,

but because of my tabs x and y i must use difrent viewcontainer.

how can i use the same view container in diferent tabs???

Former Member
0 Kudos

this for shure i now...

Former Member
0 Kudos

how can i use the same view container in different tabs???

Not possible.

Former Member
0 Kudos

Its one view container by tab. But several view in one container choosen by navigation plugs.

Let's explain this :

If your purpose is too trigger an action changing the view in tab X, in this case changing bunny into mouse, then you'll have to fire a navigation from bunny to mouse.

Let the other tab aside for now.

You have tab X containing only one view_container blah. On you're window you add the view bunny AND the view mouse to your view_container blah.

Let's choose bunny as default (the first you add is set as default anyway).

Then implement the navigation to view mouse in an event from view bunny

If your purpose is to display simultaneously two views (or more) in one tab then we're back to case one : just add two view_container (or more)  to your tab and assign each a view.

For the second tab you will have to do the same thing you did for tab 1. Create on eor more  container, assigning corresponding views to each other.

Answers (3)

Answers (3)

Former Member
0 Kudos

ok i try this

In each Tab i connected the attribute TAB_VIEW(its in the context EIN_AUS_BLENDEN) as Selected Tab

i connected the ountboundplug from bunny with the inboundplug from tiger

i Implementated a button in my view bunny whith this action (tab switch and fire outboundplug

DATA LO_ND_EIN_AUS_BLENDEN TYPE REF TO IF_WD_CONTEXT_NODE.

   DATA LO_EL_EIN_AUS_BLENDEN TYPE REF TO IF_WD_CONTEXT_ELEMENT.
   DATA LS_EIN_AUS_BLENDEN TYPE WD_THIS->ELEMENT_EIN_AUS_BLENDEN.
   DATA LV_TAB_VIEW TYPE WD_THIS->ELEMENT_EIN_AUS_BLENDEN-TAB_VIEW.

* navigate from <CONTEXT> to <EIN_AUS_BLENDEN> via lead selection
   LO_ND_EIN_AUS_BLENDEN = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_EIN_AUS_BLENDEN ).

* get element via lead selection
   LO_EL_EIN_AUS_BLENDEN = LO_ND_EIN_AUS_BLENDEN->GET_ELEMENT( ).

* @TODO handle not set lead selection
   IF LO_EL_EIN_AUS_BLENDEN IS INITIAL.
   ENDIF.


* set single attribute
   LO_EL_EIN_AUS_BLENDEN->SET_ATTRIBUTE(
     NAME `TAB_VIEW`
     VALUE = 'Y' ).

     WD_THIS->FIRE_bunny_OUT_PLG( ).

everything is working now fine...thank you all a lot!!

haha now bonny->tiger ^_^

Former Member
0 Kudos

eheheh... BonnieTyler...

Wonder if all posts were like this one if we could ever be seen as grown up people!! Says the pinguin avatar man...

amy_king
Active Contributor
0 Kudos

Hi Tobias,

Are you trying to navigate from Tab A to Tab B, or are you trying to replace View X with View Y inside Tab A?

  • Navigate from Tab A to Tab B
    • Bind the TabStrip's selectedTab property to a context attribute and set the attribute as needed.
  • Replace View X with View Y inside Tab A
    • Follow Kiran's link for navigation plugs.

Cheers,

Amy

Former Member
0 Kudos

Amy, I think he is having 2 tabs under one tabstrip and on some action he want to jump on other tab.

Am i correct Mr. Toby ? If yes then there are a property in tabstirp called as seletedTab bind it with some string type attribute and on some action in bunny set the attribute value by tiger's tab.(Tab name in which tiger lives). 

For more : Google -> tab navigation in web dynpro abap ...

Former Member
0 Kudos

Hi,

thank you all for your quick answers...it's a little bit funny...my old informatik professor always did his explanations with "blub" and "blah"...bunny and tiger is from me

omg what a long name... Chandra gets one point right...i got 2 taps.

Plz look at my picture to understand..

i think i try chandras option to navigate the tabs

but in real my problem is 1 step more deeper...

like this

as i said before it tryed to trigger the view change by using outbound and inbound plugs.

but maby i have to use a combination of that and the navigation tab thing...

i try now a little...

thanks again all of you

maybe my mouse can chatch my kitty °_°

former_member184578
Active Contributor
0 Kudos

Hi,

ore what am i doing wrong?

Yes. Because bunny cannot go to tiger as she is afraid of tiger!..

Coming to your query, you have to embed bunny view and tiger view in the View Container  blah and then you can navigate.

check this wiki: http://wiki.scn.sap.com/wiki/display/WDABAP/Conditional+View+in+Webdynpro+ABAP

Or

IS your query was to navigate from one tab(X) to another tab(Y) ?

Regards,

Kiran

amy_king
Active Contributor
0 Kudos

LOL Kiran.

former_member184578
Active Contributor
0 Kudos

Ya. Same here Amy! When i saw the query initially with blah.. blubb.. bunny.. tiger..  i couldn't stop laughing. The OP explained the issue in a very humor/ funny way..

Former Member
0 Kudos

what an explanation