cancel
Showing results for 
Search instead for 
Did you mean: 

using only 1 view from a component ( usage )

Former Member
0 Kudos

hi experts..

I have a component C1 with 7 views...

I have another componet C2 in ehich i want to use only 1 view of the component C1 rather than the entire component...

How can i do that...

jagruti

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jagruti.

While Olivier is right in mentioning that you have to take care of the navigation and also the controller data / context / state, here is the solution:

Add a ViewUIContainerElement to your view in C2.Insert the view to the window of C2 and go to the window.Here open the node of your view and you will see the

ViewUIContainerELement. Right click on that element and choose Embedd View.

But you have to define the component usage of C1 before you can select views of C1 here.

Cheers,

Sascha

Former Member
0 Kudos

sascha..

help me out with this .....

jagruti.

Former Member
0 Kudos

Hi Jagruti,

Olivier an me discussed this in this thread:

One Question. What does this button do if you only start C1? It navigates back to a view in C1?

If not you could also remove this button from the view of C1 and just let the embedding component handle this, which means you could add the button above the ViewUiContainerElement in the view of C2.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

hi..

Apart from going back it also hides the tables when enter the view again after going back...

jagruti...

Former Member
0 Kudos

ok,

then if there won't be any problem with the logic just do i the described in the thread.

But I am not sure if it works here. I assume it is as follows:

In the view you have the back button and an action which firs the outboudn which navigates to the previous view in C1. Additionally to this the idea is to fire an event here which is received by C2 which itself triggers the navigation to anaother view in C2. I am not sure how the system behaves in this case.

Cheers,

Sascha

Former Member
0 Kudos

ok

so i shud follow the link that u discussed with Oliver..is it???

dynamic navigation and stuff...

But then where will i put that code in C2 in which method ...

Because the back button is there in the view of C1 which is used in the VCU of C2.

So how do i track that the back button is clicked and now i shud fire the plug..

jagruti..

Former Member
0 Kudos

I guess it is getting a bit complicated here. I think you have to change some things:

In the component controlelr of C1 create en event (mark as interface). Then in the actíon handler method of C1 fire this event.

In the controller of view in C2 which contains the ViewUiContainerElement create an event handler method for the event of C1. In this handler you fire an outbound of the view which navigates to another view in C2.

But I guess we have a problem at this point, cause you will trigger two navigations here:

- in the action handler of view in C1 the already existing fire_outbound

- in the eventhandler of the view in C2 the new fire_outplug

But I would say just build as described above and in the thread (forget about the dynamic navigation here cause you do not need it).

Then test and tell us what happened

Cheers,

Sascha

Former Member
0 Kudos

can u make it more simpler sascha..

In the component controlelr of C1 create en event (mark as interface).

Steps below r not clear.....

Then in the actíon handler method of C1 fire this event.

In the controller of view in C2 which contains the ViewUiContainerElement create an event handler method for the event of C1. In this handler you fire an outbound of the view which navigates to another view in C2.

sorry for bugging u..

jagruti..

Former Member
0 Kudos

Hi again.

can u make it more simpler sascha..

In the component controlelr of C1 create en event

(mark as interface).

Steps below r not clear.....

Then in the actíon handler method of C1 fire this

event.

The action handler method assigned to the back button in the view you want to use in C2. Here you can use the wizzard to fire the event in the component controller. There should be a fire_... method in the component controller now.

In the controller of view in C2 which contains the

ViewUiContainerElement create an event handler method

for the event of C1. In this handler you fire an

outbound of the view which navigates to another view

in C2.

this is described in the above mention thread. In C2 you created a viuew with the ViewUiContainerElement which embedds the view with the back button of C1.

Go to the attrib utes tab of this view and add the usage of C1 here.

Then go to the methods tab of this view and create a method handleBackEvent and choose event handler. In the event columen make a F4 and select the event of the component usage C1. Hit enter.

Create an outbound plug in this view which should be use to navigate to the view in C2 you want. Then go to the event handler method just created and fire the outbound plug.

Do not forget to connect the outbound to the inbound of the view you want to navigate to.

sorry for bugging u..

No prob.

jagruti..

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

hey sascha..

ur a star man..

thanx...It works now...

jagruti...

Former Member
0 Kudos

you are welcome.

Cheers,

Sascha

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jagruti,

I suppose that a view is created by the creation of the entire component.

Views are used by windows to determine the navigation logic. Thus if you want to only use one view then you need to change the logic of your window, or create another one with its own navigation flow.

So I would recommend you to create a new window (whit its own navigation) in C1 which would reuse the sole view that you need.

Hope it helps,

Regards,

Olivier MATT

Former Member
0 Kudos

hi Oliver..

Thanx for the answer ..It works fine now..

The sole view of C1 that im using has a BACK Button.....So in onactionback i hv fired the Plugs ..So there it works fine...

But when i call that view in a different component how do i control that button...

I mean i want to fire the plug of the View in C2 where do i rite that code..

hope u got my Question...

jagruti..