cancel
Showing results for 
Search instead for 
Did you mean: 

Navigating between views in different components

Former Member
0 Kudos

Hi,

I want to navigate from view1 in comp A to view2 in compB and vice versa. I am able to do the first part view1 -> view 2 through interface controller.

Now i want to navigate back to the view1 from view2.

Please help.

Regards,

Priya

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member201361
Active Contributor
0 Kudos

Hi priya,

follow these steps to navigate from CompB to CompA.

1. create a outbound plu in the Interface View of CompB.

2. creata the same outbound plug in the window controller of compB, since Window implements Interface View or copy the Plug from interface View and paste it in the Window Controller.

3. Create a Button Say "Back" in ViewB of COmpB , and in the Action Handler of this Button , fire the out bound plug.

4. to access the window Controller, add the window controller as Required controller to ur View in Properties Tab of View Controller.

Note: After doing the above procedure, sync both the dcs and open the window controller of CompA . here u will find the Interface View of CompB with outBound plug. create the link between the Intreface View to View A by creating a Inboung Plu in View A.

Hope it helps

Edited by: Fazal Ahamed on Sep 1, 2009 4:20 PM

Former Member
0 Kudos

Hi,

Thanks for ur response.

please tel me how to connect to the 2nd view(i.e not the default view) of comp B from the view 1 of the comp A

and i need to go back depending on the scenario. i.e

if comp b 's view1 triggers comp B's view2 then the back button should take to the comp B's view 1.

if comp A's view1 triggers the comp B's view2 then the back button should go the comp A's view 1.

Thanks

Priya

Edited by: priya on Sep 1, 2009 7:05 PM

former_member201361
Active Contributor
0 Kudos

Hi Priya,

this is not possible, the default View will be displayed if u are navigating from CompA to Comp B and u cant display 2nd view(i.e not the default view) of comp B from the view 1 of the comp A.

Thanks and Regards

Former Member
0 Kudos

Hi,

Maintain a flag attribute in the context like "SourceView".

Before navigating from from View1 of CompA to View2 of CompB then populate "CompAView1" in that context attribute.

And map this context attribute between CompA View2 & CompB Interface Controller & CompB View2

Similarly before navigating from View1 of CompB to View2 of Comp then populate "CompBView1" in that context attribtue.

And map this context attribtue also between CompB View1 & CompB View2.

Now on click on back button action:

Based on the value in this context attribute invoke the corresponding fire plug.

Regards,

Charan

Former Member
0 Kudos

Hi,

Thanks for your reply.

First I need to navigate to the 2nd view (which is not a default view) of the comp B from the Comp A view.

I am not able to achive this.

please guide.

Thanks,

Priya

Edited by: priya on Sep 2, 2009 10:50 AM

former_member201361
Active Contributor
0 Kudos

Hi Priya,

As i told Earliar, navigating diretly to second View of Comp B is not possible. But if that is ur requirements, then u have to create a new component which should have just the Second View of COmpB. so u will be having three components, where u can navigate from Comp A to CompC , CompB to CompC and vice versa.

Hope it helps,

Thanks and Regards

Former Member
0 Kudos

Hi,

Create one seperate view called "NavigationView" in CompB.

This View does not contain any context or anything its just decides the navigation and invokes that corresponding plug.

Now make this "NavigationView" as default.

Create one context attribute "ToView" in NavigationView & map this context attribute to CompB interface controller and also to View1 of CompA.

Now before navigating from View1 set the value in ToView context attribtue as "View1" Or "View2"

In the init method of this "NavigationView" check the context attribute as below and navigate to View2.

if("View2".equalsIgnoreCase(wdContext.currentContextElement.getToView()))
{
wdThis.wdFirePlugToView2();
}

Regards,

Charan

Former Member
0 Kudos

Hi,

Create one outbound plug (Exit) as "ToView1OfCompA" in InterfaceViewController of ComponentB.

Now add this CompB's InterfaceViewController in the properties tab of View2 of CompB. Because of this you can access all the plugs and methods of InterfaceViewController in View2.

Now in the back button action call this outbound exit plug as below.

wdThis.wdGetComponentBInterfaceViewController().wdFirePlugToView1OfCompA();

Note: You can't use the same procedure which you did to navigate from View1 of CompA to View2 of CompB. If you add CompA as used component in CompB, you will get runtime error for cyclic dependancy.

Regards,

Charan

Former Member
0 Kudos

Hi Charan,

I am not able to add the CompB's InterfaceViewController in the properties tab of View2 of CompB.

When i click on add ReqdControllers button of the view ,it displays only component controller and the window not InterfaceViewController .

please help

Thanks,

Priya

Former Member
0 Kudos

Hi,

It should show the interface view in requried controllers list.

Add the window and check whether plug is accessible or not.

Regards,

Charan

former_member40425
Contributor
0 Kudos

Hi priya,

You have to use same procedure which you have used to nevigate from view1 to view2.

Regards,

Rohit