cancel
Showing results for 
Search instead for 
Did you mean: 

How to add an entire table to model Input

Former Member
0 Kudos

Hi,

I have a code like this:


for(int i=0;i<resbTableSize;i++){		
         po_ResbInput.setErfme(wdContext.nodeTable1_Resb ().getTable1_ResbElementAt(i).getErfme());
    po_ResbInput.setErfmg(wdContext.nodeTable1_Resb().getTable1_ResbElementAt(i).getErfmg());
poReceiptInput.addT_Resb(po_ResbInput);

Problem here is, though I am setting all the values, model Input(poReceiptInput) is taking only the last element. Can you please tell whats wrong?.

I have 11 rows in the table. When I print, I can see that I am setting all the 11 rows correctly. But in ST05, I observed that it is taking only the last row of the table and setting for the 11 rows of model input.

Thanks,

Sunita.

Message was edited by: sunita

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hi sunita,

You have to create instance for every row:


for(int i=0;i<resbTableSize;i++){		
	... po_ResbInput = new ...();//<--!!!!!!!
	po_ResbInput.setErfme( wdContext.nodeTable1_Resb ().getTable1_ResbElementAt(i).getErfme());
	po_ResbInput.setErfmg( wdContext.nodeTable1_Resb().getTable1_ResbElementAt(i).getErfmg());
	poReceiptInput.addT_Resb(po_ResbInput);
}

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

Thanks-a-lot. I did and its working. Could you please also tell how to remove previous data from model Input...I mean the po_ResbInput ?

Thanks,

Sunita

former_member182372
Active Contributor
0 Kudos

Hi Sunita,

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi,

By invalidating you can remove the previous values

node.invalidate();

Regards,

Saravanan K