cancel
Showing results for 
Search instead for 
Did you mean: 

Table Popin - how to retrieve clicked row index

former_member190457
Contributor
0 Kudos

Hi developers,

I am using table popin on Ce 711.

I would like to retrieve the index of the row where the expand/collapse button has been clicked to show/hide the popin.

I do not want to know the lead selection, but the clicked row index, how can that be done?

Thanks, regards

Vincenzo

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vincenzo,

What Bernd has mentioned is the way to go.

We also are using the popin in one of our projects.

Following is the template of the code we use for our popin in the table.

code in wdModifyView:

if(firstTime)

{

//This code assigns the name 'row' to the node element that you click i.e. to the row you click

IWDTablePopin tablePopin = (IWDTablePopin) view.getElement("Popin");

tablePopin.mappingOfOnClose().addSourceMapping("nodeElement", "row");

}

We have an action closePopin assigned to the onClose even od the popin. You have to add the Parameter of the type I<Your Table Node Name>Element to this action with the name 'row' as defined in wdModifyView. This will give you the pointer to the row you clicked. Then you can use this 'ro' to access the clicked row:

Close Action looks like:

public void onActionClosePopin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, <namespace>.I<My Table Node Name>Element row )

{

//@@begin onActionClosePopin(ServerEvent)

row.setSelectedpopin("");

//@@end

}

Regards,

Ajay

bernd_speckmann
Contributor
0 Kudos

Hi,

in wdDoModifyView do the following (this is for a CheckBoxGroup), but I think you can adapt it:


if (firstTime) {		  
IWDCheckBoxGroup cbg = (IWDCheckBoxGroup) view.getElement("GroupWBLs");
cbg.mappingOfOnToggle().addSourceMapping(IWDCheckBoxGroup.IWDOnToggle.CHECKED, "checked");
cbg.mappingOfOnToggle().addSourceMapping(IWDCheckBoxGroup.IWDOnToggle.INDEX, "index");
}

later you can use this like


public void onActionSetActiveWBLs(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, boolean checked, int index )
{
if (checked == true) {
<your code here>
}
if (checked == false ) {
<your code here accessing the relevant element via the parameter index>
wdContext.nodemynode.getmynodeElementAt(index).getElement()
}
}

Hope this helps

Bernd

Former Member
0 Kudos

In side the action onLeadSelect for the table, create a parameter(lets say "rowNumber") of type IPrivate<view-name>.I<TableNodeElement>

You'll get the index of the selected row by using rowNumber.index()

Hope this helps!

ravindra_bollapalli2
Active Contributor
0 Kudos

HI,

LET CHECK THIS WIKKI AND LET ME KNOW WHERE U R GETTING ERROR/NOT UNDERSTAND

http://wiki.sdn.sap.com/wiki/display/WDJava/TableCellPopininCe7.1withanExample.

RAVINDRA

former_member190457
Contributor
0 Kudos

Hi thanks for replying,

I understand how the procedure works and how mapping is performed.

Closing is ok.

However it seems that popins can be opened only for the lead-selected row.

Also in the code in the tutorial, you use

getLeadSelection

in order to retrieve the current row.

Can I somehow intercept the click event on non-lead selected rows?

Thanks, regards

Vincenzo