cancel
Showing results for 
Search instead for 
Did you mean: 

Add Row data dynamically into the Table Node

Former Member
0 Kudos

Hi ,

I have a requirement, where i have a dynamic table on the form which has 2 buttons : Add row /delete row.

I have 2 queries :

1. I do not want to have Add /Delete buttons on each row, is there any way to do it ? I have gone through couple of threads, but it did nt get the exact way to do it.

2. I am thinking of a checkbox where i can select add/delete row . Once I add the row and then select the row, I fill up the values. .

As i m not able to retrieve the current row index on selecting the checkbox , please let me know the java script , i tried a couple of things.. not really working .

Please let me know , any help would be highly appreciated.

Thanks,

Saujanya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Suppose the Form Hierarchy is:

BP

SubForm_Table

Btn_Add

Table

Row1

Btn_Delete

Now on the click event of the Btn_Add, add the JavaScript

this.parent.Table.Row1.instanceManager.addInstance();

And on Click of Btn_Delete, write:

this.parent.instanceManager.removeInstance( this.parent.index );

Hope this helps.

Regards,

Amit Rai

OttoGold
Active Contributor
0 Kudos

let me add few important details:

- to add a row the table subform must have content flowed (to tell the system where to add the row)

- to be able to add a row, there must be a template row available, so you need (tab binding):

--- repeat for each data item (to repeat)

--- min count one (to have the template)

- to ensure it will work any time, you must always keep at least one row (so do not delete the last one)

- make sure your form is dynamic/ interactive or no change of the generated form will be possible

- rest do as mentioned above

Regards Otto

Former Member
0 Kudos

Hi,

Thanks alot for your replies. Actually the above script didnt really work for me.

Can you please let me know the how to find the current row in a table in javascript .

I tried this : this .parent.parent.instancemanager.instanceindex.. bt it didnt work for me . Any thoughts if anything else.

Thanks,

Saujanya

Former Member
0 Kudos

Hi Saujanya,

If you have the Hierarchy as I have mentioned above, then if you write "this.parent.index" code on the button, it will return the index of that row.

Regards,

Amit

Former Member
0 Kudos

hi Amit.

thanks alot for your reply. I ll try and update the thread once i m through it.

regards,

Saujanya

Former Member
0 Kudos

hi amit,

I did try it with the same hierarchy, bt it doesnt work for me. Is it the standard btn or some other library control in the library ?

Thanks,

Saujanya

OttoGold
Active Contributor
0 Kudos

If you would send me an em-ail like "hello" to get your em-ail, I would send you the demo. Decide if that is ok for you or not:)) Have a nice day, Otto

Former Member
0 Kudos

Thanks alot Otto.

will do.

Best Regards,

Saujanya

OttoGold
Active Contributor
0 Kudos

If you find the needed detail in my demo, please share it with the rest here. I hope it solved your problem already:))

Have a nice day, regards Otto

Answers (2)

Answers (2)

Former Member
0 Kudos

Issue resolved

Former Member
0 Kudos

Hi all,

The issue is resolved. Thanks alot for all your replies. Solution is below :

subform1

Add row btn

subform 2

Delete row btn , fields in row.

Add row :

newSubform = newMainSubform.instanceManager.addInstance(1)

Delete row button :

var curr_row = poRow.index

poRow.instanceManager.removeInstance(curr_row)

With the above structure and script, the issue is resolved.

Hope this helps .

Thanks,

Saujanya

Edited by: Saujanya on Jun 29, 2010 9:36 PM