cancel
Showing results for 
Search instead for 
Did you mean: 

Exit from an embedded component

lajitha_menon
Contributor
0 Kudos

Hi,

I have 2 components, C1 and C2. C1 has got 2 views of its own, after which C2 is called. So, in the navigational diagram of C1's window, C2's interface view is embedded and its inbound interface view plug is fired on an action in C1's view. All works fine.

But I want to go back to C1 from C2, on a 'back' action in C2. I tried creating an outbound plug in C2's interface view, creating a navigational link between C2 and C1 in the window diagram where its being called from, and then firing this outbound plug in C2's action.

But it gives an error saying 'Cannot exit embedded component'. Why is that?

Any clues?

Your help is much appreciated.

Many Thanks,

LM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

L.M.,

Just to make sure: is outbound plug in C2 marked as "Exit" or as "Standard"? It should be of second type...

VS

lajitha_menon
Contributor
0 Kudos

Hi VS,

Tried Standard first and then Exit, both give the same error,

LM

Former Member
0 Kudos

L.M.,

It should be "Standard".

Try the following workaround: instead of firing plug, fire event from inner component. In view of outer component subscribe to this event, and fire plug navigation from view.

Does it work?

VS

Yashpal
Active Contributor
0 Kudos

Hi ,

The instance of the inner component is handled by the embedder component ...so how an inner comp can exit itself....create a event in the interface component controller of inner comp ...and in the embeder comp ...create a event handler which handles the event of the inner comp...in that ....u can delete the innner comp....using wdThis.wdComponentcontusagename.deleteComponent() . it delete the comp and replace the view with empty view in the event handler u can call any other view ....

see the example ....

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8d7cd90-0201-0010-4a8c-dd2...

Regards,

Yashpal

Former Member
0 Kudos

Yashpal,

"Delete component" and "Navigate away from component view" are different things...

VS

Yashpal
Active Contributor
0 Kudos

Valery ,

I just suggested him if he want to delete the comp ...

Yash

lajitha_menon
Contributor
0 Kudos

Hi Yashpal,

Thanks for the answer, but I dont think I want to delete the comp, because I am not using view-containers to embed the component. also, I need to navigate back and forth between the components, on button actions. so, I am not sure whether delete would work.

Velery, I will try using the events to navigate, and let you know how it goes, thanks,

LM

lajitha_menon
Contributor
0 Kudos

Hi VS,

I dont know what I had done wrong earlier, but tried once again using plugs, and it worked!

Thanks for your help,

LM

Answers (0)