cancel
Showing results for 
Search instead for 
Did you mean: 

How to write lead selection method for a tree by nesting table column

Former Member
0 Kudos

Hi,

I have implemented a table with TreeByNestingTableColumn(To show the tree structure in the table).I am not able to get the selected row element in lead selection method.(I am able to get parent element.) .

could anyone please tell me about this code?

BR,

Ashish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

What do you mean with "I am able to get the parent element"?

Armin

Former Member
0 Kudos

I am getting parent element means I am able to get value for the node(Instance node in my code)but do not know how to get value for recursive node(examles in my code.)

BR,

Ashish Gupta

Former Member
0 Kudos

Hi,

Follow the below steps to the solution for your problem

1. Create Action "LeadSelection" in View with parameter (name : 'seletedItem'

and type : I<your node>Element

2. Bind this action to Table property "onLeadSelec"

3. In wdModify()

IWDTable table = (IWDTable) view.getElement("Your table id");

table.mappingOfOnLeadSelect().addSourceMapping("nodeElement", "selectedEle");

4. In onActionLeadSelection()

wdComponentAPI.getMessageManager().reportSuccess("Selected Item : "+selectedEle.get<Your Node Attribute>());

Let me know if you need more clarification

Thanks

Former Member
0 Kudos

Hi Tatayya,

Thanks for the answer.I tried this but I forgot to add mapping.

Now it is working fine.

Best Regards,

Ashish Gupta

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ashish,

Go throuh this for code:[http://help.sap.com/saphelp_nw04/Helpdata/EN/c2/abfceffbacd24185ec7af8a3a2e76a/frameset.htm]

Regards,

Khushboo

Former Member
0 Kudos

Hi Ashish

Please go through this link

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c092333b-0601-0010-e7af-8c227fb6...

Hope it will be helpful for u

Regards

Ruturaj

Former Member
0 Kudos

Hi,

have you tried the currentElement method on the node that is bound to the table.

Ex: wdContext.currentContextElement();

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ,

Yes I tried with current element also(WdContext.currentInstance element) but it is giving only the parent node.

My node name is instancenode and under this node I have recursive node examples.

BR,

Ashish Gupta

Former Member
0 Kudos

hi,


 public void onActionleadselection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
int n = wdContext.nodeTable().size();
		int leadSelected = wdContext.nodeTable().getLeadSelection();
	
		// loop backwards to avoid index troubles
		for (int i = n - 1; i >= 0; --i) {
		  if (wdContext.nodeTable().isMultiSelected(i) || leadSelected == i) {
						  wdContext.nodeTable().getElementAt(i));
}
}


Former Member
0 Kudos

You mean posting this code fragment from the Table Tutorial with a comment that is misleading without the delete-operation inside the loop will help?

Armin