cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic table

Former Member
0 Kudos

Hi All

i need to develop a table in webdynpro

in that table in last colunm i have add and delete button

on clicking add button i need to add a row immediatly to next row

upon pressing delete button i need to delete the current row

Please gudie me how to handle this

Thanks

Karthi D.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

For deleting the current row you do like this.

onActionDelete(..){

wdContext.nodePerson().removeElement(wdContext.nodePerson().currentPersonElement());

}

For adding a row

onActionadd(..)

{

IPrivateFirstCompView.IPersonElement pelement=wdContext.nodePerson().createPersonElement();

pelement.set<attriute>(....);

wdContext.nodePerson().addElement(pelement);

}

(or)

if you want add a row in particular position,you can do this.

i-->position

IPrivateFirstCompView.IPersonElement pelement=wdContext.nodePerson().createPersonElement();

pelement.set<attriute>(....);

wdContext.nodeT_Return1().addElement(i,pelement);

I hope this will solve your problem.

Regards

sowmya.

Answers (2)

Answers (2)

nikhil_bose
Active Contributor
0 Kudos

To Add

onActionAddNewRow()


IPublic<componentName>.I<NodeName>Element element = wdContext.create<NodeName>Element();
wdContext.node<NodeName>().addElement( element);

To delete:

onActionDeleteRow()


IPublic<componentName>.I<NodeName>Element element = wdContext.current<NodeName>Element();
wdContext.node<NodeName>().removeElement( element);

nikhil

Former Member
0 Kudos

Hi,

Just get the index of the current selected row using

int index = wdContext.node<nodename>().getLeadSelection();

for adding a row immediately below this

create an element of the node type

IPublic<componentName>.I<nodename>Element ele = wdContext.node<nodename>().create<nodename>Element();

Add this element at the index

wdContext.node<nodename>().addElement(index,ele);

For removing the current element

wdContext.node<nodename>().removeElement(wdContext.node<nodename>().current<nodename>Element());

Regards,

Murtuza