cancel
Showing results for 
Search instead for 
Did you mean: 

Adding element in Value Node

Former Member
0 Kudos

Hi all,

I have created a value node which contains six elements in context of custom controller,

I wand to add data in this node without overwriting the previously added data., as i am binding this node to a table in view.How do i do this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi!

you can use WDCopyService.copyElements method to add in the value node.

thanks

vishal

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

IPrivate<name>View.I<name>TableNode i<name>TableNode = wdContext.node<name>Table();

IPrivate<name>View.I<name>TableElement i<name>TableElement = i<name>TableNode.createi<name>TableElement();

i<name>TableElement.set<Attribute>(<here set the value>);

........

i<name>TableNode.addElement(i<name>TableElement);

i<name>TableNode.moveNext();

you can write the above code in add button to populate the record.

Regards,

ramesh

Former Member
0 Kudos

wdContext.nodeName.createElement();

it will return u element reference.

By using this reference u will set values

Finally

wdContext.nodeName.addElement();

in this way u will add element

Regards

Ruturaj

Former Member
0 Kudos

hi,

do u want add an other value attribute in the value node or in the caontext?

if so,

open the data modeller,

double click on the data link between the custom controller and the view,

the in the context of the custom controller right click on the value node in which u want to create the value attribute and create a new value attribute.

Regards,

Satya.

Former Member
0 Kudos

hi

Depending on number of rows you want to populate the data you need to create element for each row and using that element you have to populate the data to the corresponding row and bind the created elements to the node.

For example if you want to add one row of data and you have two elements in the Valuenode(name,number).

//create element for each row

wdContext.<nodename>.createElement();

//populate the data into the row (node) using the element created above.

<elementname>.Setname()="xxx";

<elementname>.Setnumber()=xx;

//bind the created element to the node.

<nodename>.addElement();

Regards

sowmya.

Former Member
0 Kudos

Hi,

You can just try this code in a for loop

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

{

IPrivateExcelviw.IAbcElement ele = wdContext.createAbcElement();

ele.setNo(wdContext.currentAbcElement().getNo());

ele.setName(wdContext.currentAbcElement().getName());

ele.setMarks(wdContext.currentAbcElement().getMarks());

wdContext.nodeABC().addElement(ele);

}

Revert me if you have any doubts

Regards

Raghu

Former Member
0 Kudos

Thanks...Ur Reply was a lot helpfull