cancel
Showing results for 
Search instead for 
Did you mean: 

deletion of rows

Former Member
0 Kudos

Hi All,

I have requirement in which I have to delete a table record from bothe the node and the display in the view. How can I go about with this?

Thank you

Regards,

Preet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you are using some button to delete the row of a table, then in the action method of the button write the below piece of code

if(wdcontext.node<nodename>.size()>0){

int leadSelectedRow= wdcontext.node<nodename>.getleadselection();

wdcontext.node<nodename>.removeElement (wdcontext.node<nodename>.getElementAt (leadSelectedRow);

}

hope this helps you

amit bagati

Former Member
0 Kudos

Hi Amit,

Also how do I set the visible row count value of the table UI property. As I will check the size of my node and set the row count accordingly.

Thanks

Regards,

Jaspreet

Former Member
0 Kudos

HI,

1.Cretae a context attribute of type int:va_visirowCount

2.Go to layout->select the table->properties->Visisbleroucount

and select the value from context cattribute:va_visirowCount

3.In the code

wdContext.currentContextElement().setva_visirowCount(wdContext.nodeTable().size());

Regards,

Lavanya.G

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Add a extra column in the table with the link name delete.

On click on that link write the below code:

wdContext.nodeTable().invalidate();

int n = wdContext.nodeTable().size();

int leadSelected = wdContext.nodeTable().getLeadSelection();

for (int i = n - 1; i >= 0; --i) {

if (wdContext.nodeTable().isMultiSelected(i) || leadSelected == i) {

wdContext.nodeTable().removeElement(wdContext.nodeTable().getElementAt(i));

}

}

Regards,

Lavanya.G