cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in forwarding from one view to next view

Dheerendra
Participant
0 Kudos

Hi all,

I have two Views and a custome controllers, in my first view under the following method i try to fire a plug but unable to see the second view in browser...could any help me following are the coding of first view....

public void onActionRelease(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionRelease(ServerEvent)

//int n = wdContext.nodeBapi_Po_Getitemsrel_Input().nodeOutput().nodePo_Items().size();

//int leadSelected = wdContext.nodeBapi_Po_Getitemsrel_Input().nodeOutput().nodePo_Items().getLeadSelection();

try {

// int n = wdContext.nodeOutput().nodePo_Items().size();

// int leadSelected = wdContext.nodeOutput().nodePo_Items().getLeadSelection();

// for(int i=n-1; i>=0;--i)

//for(int i=0;i<=n;i++)n

// {

//if(wdContext.nodeBapi_Po_Release_Input().isMultiSelected(i) || leadSelected==i)

//for(int j=0,n=wdContext.nodePo_Items().size();j<n;++j)

for(int j=wdContext.nodePo_Items().size()-1; j>=0;--j)

{

if(wdContext.nodePo_Items().getLeadSelection()==j || wdContext.nodePo_Items().isMultiSelected(j))

{

wdContext.currentBapi_Po_Release_InputElement().setPo_Rel_Code(wdContext.currentBapi_Po_Getitemsrel_InputElement().getRel_Code());

wdContext.currentBapi_Po_Release_InputElement().setPurchaseorder(wdContext.nodePo_Items().getPo_ItemsElementAt(j).getPo_Number());

wdThis.wdGetPoReleaseCustController().executeBapi_Po_Release();

}

}

wdThis.wdGetPoReleaseCustController().executeBapi_Po_GetitemsInput();

//wdThis.wdFirePlugToResultView();

// }

} catch (RuntimeException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

//if(wdContext.nodeBapi_Po_Release_Input().nodeOutput_Release().currentOutput_ReleaseElement().getRel_Indicator_New()=="M" && wdContext.nodeBapi_Po_Release_Input().nodeOutput_Release().currentOutput_ReleaseElement().getRel_Status_New()=="")

//{

wdThis.wdFirePlugToResultView();

//}

//wdThis.wdFirePlugToResultView();

//@@end

}

//@@begin javadoc:onActionCancelRelease(ServerEvent)

/** Declared validating event handler. */

//@@end

public void onActionCancelRelease(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionCancelRelease(ServerEvent)

//int n = wdContext.nodeBapi_Po_Getitemsrel_Input().nodeOutput().nodePo_Items().size();

//int leadSelected = wdContext.nodeBapi_Po_Getitemsrel_Input().nodeOutput().nodePo_Items().getLeadSelection();

/*int n = wdContext.nodeOutput().nodePo_Items().size();

int leadSelected = wdContext.nodeOutput().nodePo_Items().getLeadSelection();

for(int i=n-1;i>=0;--i)

//for(int i=0;i<=n;i++)

{

if(wdContext.nodeOutput().nodePo_Items().isMultiSelected(i) || leadSelected==i)

{

wdContext.currentBapi_Po_Reset_Release_InputElement().setPo_Rel_Code(wdContext.currentBapi_Po_Getitemsrel_InputElement().getRel_Code());

//wdContext.currentBapi_Po_Reset_Release_InputElement().setPurchaseorder(wdContext.nodeBapi_Po_Getitemsrel_Input().nodeOutput().nodePo_Items().currentPo_ItemsElement().getPo_Number());

wdContext.currentBapi_Po_Reset_Release_InputElement().setPurchaseorder((wdContext.nodeOutput().nodePo_Items().getPo_ItemsElementAt(i)).getPo_Number());

wdThis.wdGetPoReleaseCustController().execute_Bapi_Po_Reset_Release();

}

}*/

//for(int j=0,n=wdContext.nodePo_Items().size();j<n;++j)

try {

for(int j=wdContext.nodePo_Items().size()-1; j>=0;--j)

{

if(wdContext.nodePo_Items().getLeadSelection()==j || wdContext.nodePo_Items().isMultiSelected(j))

{

wdContext.currentBapi_Po_Reset_Release_InputElement().setPo_Rel_Code(wdContext.currentBapi_Po_Getitemsrel_InputElement().getRel_Code());

wdContext.currentBapi_Po_Reset_Release_InputElement().setPurchaseorder(wdContext.nodePo_Items().getPo_ItemsElementAt(j).getPo_Number());

wdThis.wdGetPoReleaseCustController().execute_Bapi_Po_Reset_Release();

}

}

wdThis.wdGetPoReleaseCustController().executeBapi_Po_GetitemsInput();

//if(wdContext.nodeBapi_Po_Release_Input().nodeOutput_Release().currentOutput_ReleaseElement().getRel_Indicator_New()=="")

//{

//wdThis.wdFirePlugToResultView();

//}

} catch (RuntimeException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

wdThis.wdFirePlugToResultView();

//@@end

}

//@@begin javadoc:onPlugFromResultView(ServerEvent)

/** Declared validating event handler. */

//@@end

public void onPlugFromResultView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onPlugFromResultView(ServerEvent)

//@@end

}

But Above FirePlugs are not working....Why ....I do't understand ...i got to much puzzled....can any one help me.......thank's in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Yes that shoot be the problem,

you have to create the: wdThis.wdFirePlugToResultView();

in the first View( as an outbound plug)

and the: public void onPlugFromResultView

into the result view ( as an input plug)

After this you only have to create an navigation link

at the diagram view of the controlcomponent.

an then you have to bind the plugs to the buttons

Former Member
0 Kudos

Dheerendra,

Correct me if I'm wrong, but it seems that you have declared both in- and out- plugs in same view:


wdThis.wdFire<b>PlugToResultView</b>();
....
public void on<b>PlugFromResultView</b>(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

If this is true, that navigation happens, but you stay on the same view.

Otherwise this is really wired behavior: your code "eat" all exceptions and navigation must occurs even in case of error.

VS