cancel
Showing results for 
Search instead for 
Did you mean: 

Navigate from popup

Former Member
0 Kudos

Hi,

have have a view X. On front of this view, I have a popup window with to buttons. The function of one of them is navigate from the view X to another view.

If I do this using plugs, thows this exception:

"Cannot navigate from view <myview> because it is not part of the current view assembly".

I could do this by some code?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks, but those options doesnt work.

I dont understand about write an event handler. Can you explain it, please?

Former Member
0 Kudos

If find the suggestions by Siva rather strange.

Try this:

Add an event "PopupClosed" and a method "closePopup" in the component controller.

In the action handler of the button that closes the popup, call

wdThis.wdGet<ComponentControllerName>().closePopup();

In this method, close the popup window (store instance in component controller context, map it from other views that need it). After that, fire the event "PopupClosed" to notify the view that wants to navigate. This view must register an event handler for the "PopupClosed" event. In this event handler, call the outbound plug to navigate to the target view.

Armin

Answers (3)

Answers (3)

Former Member
0 Kudos

Indeed, do as Armin says, if you have problems with popups and their corresponding Event and EventHandler, check this tutorial,

[Ejercicio de Popups|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/42af9f90-0201-0010-6099-ba67e5426bdf] (Pages 18,19,20)

you can activate the FirePlug on the event handler section, once you are back into parent view.

(Gosh i wish i could attach compressed examples here xD)

Regards. Saludos

Julio Herrera

Former Member
0 Kudos

Hi,

Are this plugs part of the window which contains the popup.

Regards

Ayyapparaj

Former Member
0 Kudos

No, the plugs are part from the principal window.

Thanks.

Former Member
0 Kudos

Hi,

You can try to fire an event from the popup window and write the event handler in th view which need to be rendered.

in side the event handler fire the plug.

Regards

Ayyapparaj

former_member197348
Active Contributor
0 Kudos

Hi Francisco,

Create an attribute navigate in view X and controller and pop up (myview). Map them using context mapping.

onAction<button>() in myview

set the attribute navigate to "view2"

in wdDoModifyView() of view X.

{

if(navigate.equalsIgnoreCase("view2"))

wdThis.wdFirePlugOutview2();

}

regards,

Siva

Former Member
0 Kudos

Siva, this doesnt work. I dont know why, but I call the method fireplug like you said but it dont navigate.

former_member197348
Active Contributor
0 Kudos

Hi Francisco,

Here is the solution if and only if the navigation to second view is a must after pop up. Probably this solution may be not wise but it fulfills your requirement. You can use infinite loop at the end of the method where you are calling pop up. Use in view X immediately after calling pop up

for(;;);

{

if(navigate.equalsIgnoreCase("view2"))

{

wdThis.wdFirePlugOutview2();

break;

}

}

regards,

Siva