cancel
Showing results for 
Search instead for 
Did you mean: 

Forcing LeadSelection

Former Member
0 Kudos

Hello,

I have a table in main view binded to MainTable. In the details view it is binded detailsTable. How can I force the leadSelection change in the details view/detailsTable.

When the user changes the leadselection in the mainview/MainTable, In the Details View/DetailsTable, I have to show the details accordingly.

Thanks,

Sunita.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

The detailsTable must be binded to some context node.

On lead selection in MainTable you can trigger the action which populates the context node binded to the DetailsTable.

Specify the action in the onLeadSelection property for MainTable. In this action populate the context node binded to the Details view according to the selection.

To get the value in selection you can simply do following call: wdContext.node<MainTableNode>.current<MainTableNodeElement>

This tutorial does exactly what you want:

<u>PDF:</u> https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/5f699f90-0201...

<u>Details:</u> https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94a...

Regards,

Ashwani Kr Sharma

Answers (4)

Answers (4)

Former Member
0 Kudos

Bind the details view to main node.

Former Member
0 Kudos

Thanks guys. It will be better to bind to same table node.

Former Member
0 Kudos

Web Dynpro has been designed to support such master/detail scenarios very easily.

Just bind the details form to the same attributes (inside the data source node) as the table cell editors, assign an empty action to the Table.onLeadSelect event (such that a roundtrip is triggered when the master selection changes). That' all.

Armin

former_member751941
Active Contributor
0 Kudos

Hi Sunita,

Try this.

1> Go to the View create an action say “populateDetails”

2> Bind the action (populateDetails) in the “onLeadSelect” property of maintable.

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

{

int n = wdContext.nodeMainTableNode().size();

int leadSelected = wdContext.nodeMainTableNode().getLeadSelection();

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

if (leadSelected == i) {

IPrivateEpSyncView.IDetailsTableNodeElement DetailsTableNodeElement = wdContext.createDetailsTableNodeElement();

DetailsTableNodeElement.setPORTALID(wdContext.nodeMainTableNode().getMainTableNodeElementAt(i).getPORTALID());

DetailsTableNodeElement.setUSER(wdContext.nodeMainTableNode().getMainTableNodeElementAt(i).getPORTALNAME());

DetailsTableNodeElement.setROLE(wdContext.nodeMainTableNode().getMainTableNodeElementAt(i).getGROUPEXPRESSION());

DetailsTableNodeElement.setSTATUS(wdContext.nodeMainTableNode().getMainTableNodeElementAt(i).getSTATUS());

wdContext.nodeDetailsTableNode().addElement(DetailsTableNodeElement);

}

}

}

Regards,

Mithu