cancel
Showing results for 
Search instead for 
Did you mean: 

Making onLeadSelection disabled

Former Member
0 Kudos

hi

I have developed an application in web dynpro, and using ABAP as the backend for retrieving data.

I am calling a BAPi from the initial screen by giving some input parameters and displaying the retrieved data in the second screen.

Now based on the first BAPi output I am calling another BAPi and displaying the output in the third screen by using onLeadSelection method.

Now my problem is that when I come from third screen to the second screen by using "LinktoAction" the first BAPI output is displayed with one row showed as selected.

Now my problem is that I dont want that selected row to be shown when I come back to the second screen from third screen.

can anyone help me in this issue.

thanks and rergards

kris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gopi,

Inside the plug handler of the second view (i.e the plug handler for the plug from third view to second view), set the lead selection for the node bound to the second view's table as null:

wdContext.node<node name>().setLeadSelection(-1);

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

hi Nibu

Thanks for ur fast response.

I have tried this, when coming from third screen to the second screen I am not getting any values displayed when I am using this

wdContext.node<node name>().setLeadSelection(-1);

So is there any other way to achieve this.Kindly let me know.

thanks and regards

kris

Former Member
0 Kudos

You must have invalidated the node somewhere.

Can u check that ?

Regarsa

Bharath

Former Member
0 Kudos

Hi Gopi,

Setting the LeadSelection to null shouldn't cause you any problem, unless you use the lead selection somewhere to fetch the data. Please verify this. If possible, post your relevant code (code for the LinkToAction, plug method & data fetching) here so that someone may be able to figure out what is wrong.

Best Regards,

Nibu.

Former Member
0 Kudos

hi Nibu

Thanks for your response.

I have used the onLeadSelection to call the second BAPi, and display the results of the secomd BAPI.

Now on calling the first BAPI, I have made the node property "initilLeadSelection" to false, such that no particular row is being selected by default.

and every row is being selectable.

Now my problem is that when I come from third screen to the second screen by using plugin "linkToAction" the same should be displayed as is the case when I come from first screen to the second screen, that is again no row should be enabled and all the rows should be selectable.

Can u please tell me how can we disable the initialLaeadSelection by using plugin, when coming from third screen ti second screen.

I am sending you the code for the LinkToAction method.

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

{

//@@begin onActiontoList(ServerEvent)

wdThis.wdFirePlugToOrderStatusResults();

wdContext.nodeOutput().setLeadSelection(-1);

//@@end

}

code for the second BAPI:

public void executeZ_Vf_CustomerDetails( )

{

//@@begin executeZ_Vf_CustomerDetails()

try

{

Z_Vf_Customer_Order_Detail_Input output=new Z_Vf_Customer_Order_Detail_Input();

wdContext.nodeZ_Vf_Customer_Order_Detail_Input().bind(output);

// Calls remote function module

output.setSd_Doc(wdContext.nodeSales_Order_List().currentSales_Order_ListElement().getSd_Doc());

wdContext.currentZ_Vf_Customer_Order_Detail_InputElement().modelObject().execute();

// Synchronise the data in the context with the data in the model

wdContext.nodeOutput_Details().invalidate();

}

catch (Exception ex)

{

// If an exception is thrown, then the stack trace will be printed

ex.printStackTrace();

}

//@@end

}

code for plug method:

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

{

//@@begin onPlugFromOrderStatusDetails(ServerEvent)

wdContext.nodeZ_Vf_Customer_Orderstatus_List_Input().setLeadSelection(0);

//@@end

}

can u help me in this issue.

thanks and regards

kris

Former Member
0 Kudos

Hi,

While you are comin back.. in the inbound plug.. you are setting the leadselection.. Right ?

You can disable the leadselection line.. and am sure that the status wont change.:).!

Can you print the size of the node once u come back.. and why do yo set the leadselection to '0'. For no selection it is -1.

Is this for some other purpose .?

Regards

Bharathwaj

Former Member
0 Kudos

Hi Gopi,

I am replying based on the following assumptions:

1) You have bound the node 'Output' to the second view's table

2) On coming back from the third view to the second view, you are again calling the BAPI to fetch the data.

If this is not the case, i.e if you are not fetching the data again, write 'wdContext.nodeOutput().setLeadSelection(-1);'

inside 'onPlugFromOrderStatusDetails' and not inside the BAPI call method.

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

{

//@@begin onActiontoList(ServerEvent)

wdThis.wdFirePlugToOrderStatusResults();

<b>/wdContext.nodeOutput().setLeadSelection(-1);/</b>

<b>Delete this line</b>

//@@end

}

public void executeZ_Vf_CustomerDetails( )

{

//@@begin executeZ_Vf_CustomerDetails()

try

{

Z_Vf_Customer_Order_Detail_Input output=new Z_Vf_Customer_Order_Detail_Input();

wdContext.nodeZ_Vf_Customer_Order_Detail_Input().bind(output);

// Calls remote function module

output.setSd_Doc(wdContext.nodeSales_Order_List().currentSales_Order_ListElement().getSd_Doc());

wdContext.currentZ_Vf_Customer_Order_Detail_InputElement().modelObject().execute();

// Synchronise the data in the context with the data in the model

wdContext.nodeOutput_Details().invalidate();

<b>wdContext.nodeOutput().setLeadSelection(-1);</b>

}

catch (Exception ex)

{

// If an exception is thrown, then the stack trace will be printed

ex.printStackTrace();

}

//@@end

}

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

{

//@@begin onPlugFromOrderStatusDetails(ServerEvent)

<b>wdContext.nodeZ_Vf_Customer_Orderstatus_List_Input().setLeadSelection(0);</b>

<b>..why do you need this?</b>

//@@end

}

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Nibu ,

Thanks for your response,

I applied what you said Changes.

But there is no result(eempty) will be displayed.

Regards

Kris

Answers (1)

Answers (1)

Former Member
0 Kudos

closing the thread