cancel
Showing results for 
Search instead for 
Did you mean: 

Deciding the outbound plug dynamically (at run time).

Former Member
0 Kudos

Hello All,

I have a business rule condition in which one View (View A) gets accessed from 2 other views (View B and View C). I have created two in-bound plugs one each for View B and View C.

The View A has one "back" button. On clicking it, the user should be returned to the view from where he came from (it could be View B or View C). My issue is that how do I identify correctly, from where (View B or View C) the user reached View A.

My approach was to add an attribute in the context which would hold values like "fromViewB" or "fromViewC". View A's outbound plug would check the context variable before deciding on which plug to fire.

But I feel that there would be more simpler and time tested features which would help me with this. Any better ideas?

Thanks in Advance,

Sachin.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sachin,

When you click BACK button, there would be a condition which will determine to which view it should return (ViewB or ViewC)... right?

In action handler for BACK button (say onActionBack()) .. you can write like this:

 if(condition-1){
wdThis.wdFirePlugToViewB();
}else (
wdThis.wdFirePlugToViewC();

}

<i>My approach was to add an attribute in the context which would hold values like "fromViewB" or "fromViewC". View A's outbound plug would check the context variable before deciding on which plug to fire.</i>

>>>> >>>> This approach is also fine, but please create the valueAttribute in component controller and context-map it to your View.

Regards,

SK.

<i>PS: Plz reward points for helpful answers!</i>

Answers (0)