cancel
Showing results for 
Search instead for 
Did you mean: 

Code to delete a node from the tab that satisfy the given condition

Former Member
0 Kudos

Hi Experts,

I have a scenario of escalation i.e., Deletion of the message details from the table of a tab when that row of details move to second tab based on status condition. I am unable to delete the escalated row details from first tab.

Can any one provide me the code..

Thanks & Regards,

Priya

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Priya,

Let me know whether my following assumption is right or worng !!

You have two tables in different tabs and trying to move some rows from table1 in tab1 to table2 in tab2.But you can;t able to delete the rows in table1 of tab1 ..is that correct ??

You can use wdContext.node<NodeName>().removeElement(IWDNodeElement) to delete a row from a table.

Ex :

wdContext.nodeEmployee().removeElement(wdContext.nodeEmployee().getElementAt(0));

will remove the first element from the node.

Regards,Anilkumar

Former Member
0 Kudos

Hi Anil,

I need to remove the Message Details that satisfy the condition like if MsgId of Table2 of tab2 is equal to MsgId of Table1 of Tab1.. than the details of that MsgId must be removed from Table1 of Tab1.

The first row is deleted by your code.. but I need the deletion of the details that satisfy the above condition..

Regards,

Priya

Former Member
0 Kudos

Priya,

In this case you need perform compare operation between the two nodes bound to the two tables.

Try this.

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

{

String id= wdContext.nodeTable2().getElementAt(i).getAttributeValue("MsgId");

for(int j=0;j< wdContext.nodeTable1().size();j++)

{

String id1= wdContext.nodeTable1().getElementAt(j).getAttributeValue("MsgId");

if(id.trim().equals(id1))

wdContext.nodeTable1().removeElement(wdContext.nodeTable1().getElementAt(j));

}

}

Regards,Anilkumar

Former Member
0 Kudos

Check this too

-Anilkumar

Former Member
0 Kudos

Thanks Anil.. Code is working..

Regards,

Priya