cancel
Showing results for 
Search instead for 
Did you mean: 

adding new row in a table

Former Member
0 Kudos

hi experts ,

i am working on a table and on an action of button i need to add a row. The table has a lots of elements like input fields, dropdown by key, textviews etc. i have created a new row by incresing visible row count on action but the above mentioned elements are not editable . The cardinality of the node bound to table is 1..n and selection is 1....n.

Please suggest me a proper solution.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

try this code,



here "<name>Table" is the node , which is dataSource to Table UI.

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>(<value>); // if you want to set default values to attributes 

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

Regards,

ramesh

Answers (4)

Answers (4)

Former Member
0 Kudos

thanks ramesh

its done.........

Former Member
0 Kudos

Hi,

Try this code,

IPrivatePopUpMenuView.IProductsElement ele=wdContext.createProductsElement();
			ele.setProductId(str1);
		ele.setQuantity(str2);
		ele.setPrice(str3);
		ele.setName(str4);	
		ele.setDetails("Detailed discription for  "+str4);
		wdContext.nodeProducts().addElement(ele);

Here str1 str2 are all the value which unwant to add to table.

Regards,

H.V.Swathi

Former Member
0 Kudos

You should create new element for the node and add it. This should happen in onActionClick of your button. Use the lines mentioned in above post to create and add element for the new row.

Former Member
0 Kudos

Hi

try this code , i hope cardinality for the table node should be 0..n and selection as 1..n

IPriavte<nodename>.IContextelementName abdc = wdcontext.node<Nodename>.createNodeElement();

wdcotext.node<Node> .addelement(abdc);

try this hope should work