cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert values in a perticular record in a blank(empty) table ?

Former Member
0 Kudos

Hi Experts,

I have created a blank table (1 column,6 rows)dyanamically.

Now I want to insert " *** " at perticular record(row).Say I want to insert " *** " in the 2nd record(row).

My table is a blank table.

Please suggest me.

Regards

-Sandip

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Sandeep,

You can create blank records like this:

for(int i=0;i<6;i++)
{
wdContext.node<nodename>().addElement(wdContext.create<node>Element());
}

If you have already created elements, then to insert value in a particular row (say i th row)

wdContext.node<nodename>().get<node>ElemenAt(i).set<attributename>("***");

regards,

Siva

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Sandip, when the table is empty, you can create a node element (The table must be binding with a Node). The code to do this will be:


IPrivate<viewName>.I<nodeName>Element ele = wdContext.node<nodeName>.create<NodeName>Element();

ele.set<atributeElement>();

wdContext.node<nodeName>.add(ele);

You need this if the node's cardinality is 0..n.

After the Node has elements, you can get or set to an specific element with the next code:


wdContext.node<nodeName>.get<nodeName>ElementAt(<index>).get<atributeElement>();
wdContext.node<nodeName>.get<nodeName>ElementAt(<index>).set<atributeElement>();

The index refers to the position (row) of the table.

I hope this help you.

Best Regards,

Simon.

Former Member
0 Kudos

Hi,

Now I want to insert " *** " at perticular record(row).Say I want to insert " *** " in the 2nd record(row).

wdContext.node<YourNode>().setLeadSelection(2);

wdContext.current<YourContextElement>().setAttributeValue("<columnName>","****");

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ,

go thru this forum link..

GS

amolgupta
Active Contributor
0 Kudos

hi,

to have blank rows create element of the context and add to the context which in turn is bound to the table.

suppose u want to add a row to the second row....

u'll have to add first row first.

regards,

-Ag.

Former Member
0 Kudos

hi,

just add some values into the context node, to which your table is binded.