Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Adding / Deleteing Rows

Avatar

Level 4

I'm aware of how to Add or Delete a Row to a table where the buttons are located within the table (see Sample 1) but can you have the button located at the buttom of a page instead, outside the table (see Sample 2).  If yes, can you please assist me with the scripting

The reason for this is that I want the row being inserted not to include the Add / Delete buttons again.

Any assistance would be greatly appreciated.

Regards

Jen

1 Accepted Solution

Avatar

Correct answer by
Level 10

I was merely showing you how to add with the FormCalc reference. You can now add th erest if statement and the rst of your code to the expression.

Paul

View solution in original post

0 Replies

Avatar

Level 10

The Add row can certainly live outside of the actual row (when you do an addInstance you are merely adding to the bottom of the stack of subforms). The deleteInstance requires an occurance number so that we know which row to delete. When we add the delete button to th erow we can get the instance number by knowing which button they pressed. This can now be used to remove the right instance. You can have the delete button outside but you will have to indicate which one to delete (it could be the last one, the user could indicate which one).

Make sense?

Paul

Avatar

Level 4

Thanks.  I have got it to work but unfortunately when the row is added the formula isn't updating and therefore is incorrect.

Is there some way of getting the formula to automatic update for the inserted line?

Jen

Avatar

Level 10

This is a case where FormCalc is much easier than Javascript. Have a look at what I have done in this modifies sample.

Paul

Avatar

Level 4

The formula that you have used isn't achieving the same end result that I was getting with my 'If' statement.

Your formula

Cell3 + Cell4 + Cell5 + Cell6 + Cell7 + Cell8

My formula

if (Table1.HeaderRow2.Cell3.rawValue == null) {

this.rawValue = Table1.Row1.Cell3.rawValue + Table1.Row1.Cell4.rawValue + Table1.Row1.Cell5.rawValue + Table1.Row1.Cell6.rawValue + Table1.Row1.Cell7.rawValue + Table1.Row1.Cell8.rawValue;

}

else{

this.rawValue = Table1.Row1.Cell3.rawValue*Table1.HeaderRow2.Cell3.rawValue + Table1.Row1.Cell4.rawValue*Table1.HeaderRow2.Cell4.rawValue + Table1.Row1.Cell5.rawValue*Table1.HeaderRow2.Cell5.rawValue + Table1.Row1.Cell6.rawValue*Table1.HeaderRow2.Cell6.rawValue + Table1.Row1.Cell7.rawValue*Table1.HeaderRow2.Cell7.rawValue + Table1.Row1.Cell8.rawValue*Table1.HeaderRow2.Cell8.rawValue;

}

Avatar

Correct answer by
Level 10

I was merely showing you how to add with the FormCalc reference. You can now add th erest if statement and the rst of your code to the expression.

Paul

Avatar

Level 4

I have managed to get this to work, thanks,  but now have a slightly different query.

I am wanting to have a click button where the user is able to duplicate a table rather than just a row.

Is this possible and if yes how.  If need be I can e-mail the document to you.

Cheers

Jenny

Avatar

Level 10

It is the same technique as adding the row .....the code to add the row navigates down to the row subform level. To add the complete table modify the statement to stop at the Table level instaed of the row level.

Make sense?

Paul

Avatar

Level 4

This is the coding that I used for duplicating the table but it isn't working.  I have

Subform1.Table2.addInstance(1);

Since we can't upload attachment this is basically the page layout:

Page2

     Subform1

          Table2

               Row1

               Row2

               Row3

               Row4

               Row5

     Subform2

          Button1 (this is my add table button)

Your assistance would be greatly appreciated

Jenny

Avatar

Level 4

Date: Fri, 19 Mar 2010 06:55:34 -0600

From: forums@adobe.com

To: bluey72@live.com

Subject: Adding / Deleteing Rows

Can you post your form to mailto:LiveCycle8@gmail.com and I will have a look.

paul

>

Avatar

Level 4

Going forward with my 'Adding Rows' button, is it possible to have the table headings repeated at the beginning of a new page should it roll over when new rows are added (by the clicking the 'Add Row' button).

e.g. The top two greyed rows need to be repeated (at the top of the page) only when the information underneath rolls over to a new page.  Hope this makes sense!!!

I have e-mail the attached to you.

Regards

Jenny

Avatar

Level 4

Hi Paul,



Sorry to do this but can you help again?

I have made you the changes that you suggested but when it all gets put together, it doesn't formatt correctly.  I have e-mailed the attachment to you.

* As you will see the Header (two greyed rows) doesn't carry over on every page for some reason.
* Are we able to arrange for when the new Add Row is inserted that it actually starts on a new page?
* The attachment I actually created an additional two Rows but it hasn't saved the text into the rows making me believe that the Add Row button isn't working correctly.

Regards
Jen

Avatar

Level 10

I did not receive an email from you .....did you send it to:

LiveCycle8@gmail.com

Paul

Avatar

Level 4

Hi Paul,

Sorry to do this but can you help again?

I have made you the changes that you suggested but when it all gets put together, it doesn't formatt correctly.

  • As you will see the Header (two greyed rows) doesn't carry over on every page for some reason.

  • Are we able to arrange for when the new Add Row is inserted that it actually starts on a new page?

  • The attachment I actually created an additional two Rows but it hasn't saved the text into the rows making me believe that the Add Row button isn't working correctly.

Regards

Jen

Date: Thu, 15 Apr 2010 06:09:26 -0600

From: forums@adobe.com

To: bluey72@live.com

Subject: Adding / Deleteing Rows

I did not receive an email from you .....did you send it to:

mailto:LiveCycle8@gmail.com

Paul

>