cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new rows dynamically

Former Member
0 Kudos

Hi all you,

I'd like to add new rows dynamically while i'm calculating different totals per page.

I tried to use thise javascript :

var anInstanceManager = data.OpenItemList.ItemTable.BalanceOpenItemList.instanceManager;

var newInstance = anInstanceManager.addInstance(1);

But i get an error : "BalanceOpenItemList has no properties".

Do you have any idea ?

Edited by: Brice VINCENT on Aug 19, 2009 5:45 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nikhil,

This can be work with the case that I want to have push button to click to create new line or new table?

My case is allow user to click to add new line or new group of field if it is required.

Please point me out how I can do that?

Thanks,

Visut

chintan_virani
Active Contributor
0 Kudos

Are you using two ids at SDN !!!, One should be enough to get responses anyways!!

Chintan

Former Member
0 Kudos

Chintan,

Just want to have my own SDN ID. Another user is pool user from project that anyone in my team can use.

That's ok???

Visut

nikhilkup
Active Participant
0 Kudos

hi,

add the below code in event click in javascript

Table 1 = name of your table

var nTableLength = Table1.nodes.length;

var nNumRow = 0;

for (var nCount = 0; nCount < nTableLength; nCount ++) {

if ((Table1.nodes.item(nCount).className == "subform") & (Table1.nodes.item(nCount).name !== "HeaderRow")) {

nNumRow = nNumRow + 1;

}

}

if (nNumRow == 7) {

xfa.host.messageBox("The maximum allowable number of rows is 7. You cannot add any more rows.", "Warning", 3);

}

else {

Items.Table1.Row1.instanceManager.addInstance(1);

}

Former Member
0 Kudos

Thanks Nikhil for your response,

But your answer works only with user interaction.

I'd like to perform this action at Form processing, before the form is displayed to the user.

And in this case, this code doesn't work.

I get an error : Unable to create SOM Expression.

It drives me mad...

chintan_virani
Active Contributor
0 Kudos

Visut / Brice,

That's fine. Could you please explain your requirement in more detail and mention in steps if possible like what you are doing and what you want to achieve.

Chintan

Former Member
0 Kudos

Chintan

In my case, I have requirement to allow new position belong to more than one department. In initial in my form should show only one department field and related information of selected department field. And if that position should be manager of more than one department. User allows to click Add new department field and form will add additional line for department field and related field.

Thanks for your guideline.

Visut