Skip to Content
0
Former Member
Oct 19, 2006 at 12:22 PM

Doubt in Multiselection in a table

16 Views

Hi All,

I have a table and have to to multiselection.While doing the multiselection I have to pass the few things for the selected rows to a BAPI which will process and give the output accordingly.

In an action handler I am writing the following code:

//*****Trying the multiselection****//

IOPENITEMS_openElement tableEle = null;

IPrivateCreateResultIPView.IMultiNodeElement ele = wdContext.nodeMultiNode().createMultiNodeElement();

for(int i=0;i<wdContext.nodeOPENITEMS_open().size();i++){

wdComponentAPI.getMessageManager().reportSuccess(" Size is :"+wdContext.nodeOPENITEMS_open().size());

boolean aa = wdContext.nodeOPENITEMS_open().isMultiSelected(i);

wdComponentAPI.getMessageManager().reportSuccess("Selected : "+i " : Val "aa);

if(aa){

wdComponentAPI.getMessageManager().reportSuccess(" Selected "+i);

tableEle = (IOPENITEMS_openElement)wdContext.nodeOPENITEMS_open().getElementAt(i);

ele.setMultiDocno(tableEle.getDOC_NO());

ele.setMultiItem(tableEle.getITEM());

ele.setMultiRep(tableEle.getREP_ITEM());

ele.setMultiSub(tableEle.getSUB_ITEM());

wdContext.nodeMultiNode().addElement(ele);

}

}

//****Ends here***//

here multiNode is a local View node that I have taken to collect the records or the data for the selected rows.

The Exception that i am getting

com.sap.tc.webdynpro.progmodel.context.ContextException: Node(CreateResultIPView.multiNode): cannot bind or add element, because it is already bound to a node

at com.sap.tc.webdynpro.progmodel.context.Node.prepareAddElement(Node.java:645)

at com.sap.tc.webdynpro.progmodel.context.Node.addElement(Node.java:631)

at com.accenture.pct.rrs.installmentplan.CreateResultIPView.onActionCreateInstallmentPlan(CreateResultIPView.java:462)

at com.accenture.pct.rrs.installmentplan.wdp.InternalCreateResultIPView.wdInvokeEventHandler(InternalCreateResultIPView.java:1597)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

Kindly give a solution to the problem.I have been struggling for the past one whole day.

looking forward to you.

Regards

DK