cancel
Showing results for 
Search instead for 
Did you mean: 

trigger view

Former Member
0 Kudos
60

Hi,

I want to trigger different forms on parameter scenario. So each scenario has his on view/form. How can i do this. Do i need to define parameters in the plugs? what code do i need to use?

thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try this

if

(wdContext.currentOutputElement().getScenario().equals("YWPA"))

wdThis.wdFirePlugToYWPA();

else

if

(wdContext.currentOutputElement().getScenario.equals ("YEMP"))

wdThis.wdFirePlugToYEMP();

Regards,

Ajay

Former Member
0 Kudos

Ajay,

This solved the problem thanks

Former Member
0 Kudos

Try this:

if

(wdContext.currentOutputElement().getScenario().equals("YWPA"))

wdThis.wdFirePlugToYWPA();

else

if

(wdContext.currentOutputElement().getScenario.equals("YEMP"))

wdThis.wdFirePlugToYEMP();

Answers (5)

Answers (5)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Through the fire plug methods u can easily pass the values between two views.

while creating outbound and inbound plugs create the parameters also for them.

in the 1 view implementation on button action:

onAction()

{

String name = wdContext.currentContextElement().get<att>();

wdthis.wdfireplugto2view(name);

}

In the second view implementation:

onplugfrom1view(){

wdContext.currentContextElement().setRes(name);

}

U can use context mapping for passing parameters,

Create a context in controller, view1, view2.

Map view1 to controller and similarly do for view2.

set the value in the context attribute of view1 u can get

in view2 also.

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

Hi

If I understand correctly then you want to navigate from your first view to various views depending on some parameter's value.

In this case you can create outbound plugs in your masterview for all the views you want to navigate to.

Lets assume you have a button Go which should navigate you to the next view.Then you can write the code

like this in the action assigned to this button.

Assuming you store the parameter value in context attribute Param of type String

if(wdContext.currentContextElement().getParam().equals(<value1>)

wdThis.wdFirePlug<outbound plug name for view1>();

else

if(wdContext.currentContextElement().getParam().equals(<value2>)

wdThis.wdFirePlug<outbound plug name for view2>();

else

so on

Regards,

Ajay

Former Member
0 Kudos

ajay, I get an syntax error when i type else

if

(wdContext.currentOutputElement().getScenario().equals("YWPA"));

wdThis.wdFirePlugToYWPA();

else

if

(wdContext.currentOutputElement().getScenario.equals("YEMP"));

wdThis.wdFirePlugToYEMP();

Message was edited by: Eoin Cronan

Former Member
0 Kudos

Hi Eoin,

You don't have to put a semicolon after the if condition.Your code should be like this,

if

(wdContext.currentOutputElement().getScenario().equals("YWPA"))

wdThis.wdFirePlugToYWPA();

else

if

(wdContext.currentOutputElement().getScenario.equals("YEMP"))

wdThis.wdFirePlugToYEMP();

Former Member
0 Kudos

Hi Eoin,

Your masterview should be set as the default view of the window.From your masterview have statically set outbound plugs to the different views that need to be there. Depending on the parameter condition fire the respective plug to go to the view that is required.

regards,

Deepak

Former Member
0 Kudos

hi Eoin,

Inrespect to your problem, if u want to trigger different views. Then this should be based on some validatations, where you are comparing some paramters and based on that you can trigger that particular view.

Just create fire plugs and depending on the type of parameters validatations call that particular view.

For example if u want to call a view on some event onClick(), then code in the onClick method.

then If(parameter ==expected)

{then call that particular view.

Hope this might be helpful to you.

Thanks,

kris

Former Member
0 Kudos

where should I make the code and how should it look like? i suppose i need to use the code in the masterview?

Former Member
0 Kudos

Hi,

You can use the different plugs and use them according to your scenario and u can send parameters thru plugs

Regards,

Saravanan K

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

See this link for sample examples about plug in and plug out:<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/91b6ad90-0201-0010-efa3-9626d2685b6e">Here</a>

In case if your not passing many parameters you can use Portal eventing also.<a href="http://help.sap.com/bp_epv160/documentation/How-to_Guides/32_HowTo_Use_portal_eventing.pdf">Here</a>

Regards

Suresh