cancel
Showing results for 
Search instead for 
Did you mean: 

Read elements of a table

Former Member
0 Kudos

HI all,

I have a table with about 100 rows and 6 columns. I want to read each and every element of the table for implementing some checks and using each of them individually further. Could you please help me, how to do so.

Cheers Umang

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

use the following code choose one of them based on your requirement

code is based on the node called "Orders" and its Elements so you need to change this according to yours


for(int x=0; x<wdContext.nodeOrders().size(); x++)
	  {
		  //Generic Approach
		  IWDNodeElement element = wdContext.nodeOrders().getElementAt(x);
		  Object obj = element.getAttributeValue("<Your Attribute Name>");
		  //Typed Approach
		  IOrdersElement element2 = wdContext.nodeOrders().getOrdersElementAt(x);
		  String type = element2.getOrderType();
		  
	  }

Regards

Ayyapparaj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Suppose u have a node say ctx_va_table which is bound to ur table then use the following code to read each and every element of ur table.


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

    wdContext.nodeCtx_va_table ().setLeadSelection.(i);
    wdContext.currentCtx_va_tableElement.getcolumn1();//replace column1..column6 by ur actual value attribute name
    wdContext.currentCtx_va_tableElement.getcolumn2();
    wdContext.currentCtx_va_tableElement.getcolumn3();
    wdContext.currentCtx_va_tableElement.getcolumn4();
    wdContext.currentCtx_va_tableElement.getcolumn5();
    wdContext.currentCtx_va_tableElement.getcolumn6();

}
 wdContext.nodeCtx_va_table ().setLeadSelection.(0);

Regards

Surender Dahiya