addInstance not working on button click

Avatar

10-10-2008

I have a row table bound to a list on xsd and it is working fine, displaying all rows present on my xml.



I created a button in order to add rows to this table, for the user to fill in data. On the Javascript click event of the button I added the addInstance(true) with no success. However, the same code snippet is able to add instances of the row if placed on the initialize event of the same button!



This is the code:

TablePagamento._RowPagamento.addInstance(true);



So, why isn't the click event working but the initialize is?



By the way, my form has 3 different master pages, and I am beggining to think this is the problem, since I can make the above code work on a blank form with a single master page.

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

10-10-2008

Are you defining your form as a dynamic form?

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

13-10-2008

My guess is that the subform TablePagamento is in a different context that the button so it cannot be found. Try pathing your way from the root all the way down to the subform.....so it should look something like this:



form1.Page1.TablePagamento._RowPagamento.addInstance(true);

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

14-10-2008

Can you post your form and any associated data files or schemas to livecycle8@gmail.com and I will have a look at it.

Avatar

Avatar
Boost 1
Level 2
Luigi_247_365
Level 2

Likes

2 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 2
Luigi_247_365
Level 2

Likes

2 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
Luigi_247_365
Level 2

14-10-2008

Hi Marcelo,



It all has to do with (look here)



1) UPPER Subform CONTENT must be FLOWED

2) Min Occurence/Count & Max Occurence/Count

a) For Subforms check Binding Tab (Repeat Subform for each data item)

b) For Components Check Min Count & Max Count



If you have multiple Subforms within Subforms within Subforms...

definatly check the above two points, they will sort you out!



Advice.



Start a new document. Try it with one Subform. MAke it work, then add another subform that encapsulates the original subform and try make it work.. etc! until it represents your form structure! You will learn how the min/max works.