Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

delete and print problem

Avatar

Level 2

Hai,

I've put two forms togethet and now my delete button (wis) erases everything instead of only one row, whats gone wrong?
I made the buttons so that i can delete a row if a child on my department has go away, please help.-----> see pdf, page 2 and 3

I also have the problem that i want to print only one page with my button instead of the hole pdf, does anyone now how i can fix to print one page with each button.-----> see pdf, page 2 and 3

Thanks and greetz,

Josh

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

There are a few things going on here.

The easiest is the print button. Check out the help file for the eight parameters in the standard script. Parameter 2 sets the start page (based on a zero numbering system); the third parameter sets the finish page. So if you look at the print button on page 2 it now looks like this:

xfa.host.print(1, "1", "1", 0, 0, 0, 0, 0);

Now on page 2, the table rows were not uniquely referenced. There were a lot of Row2[*]. So script referencing Roe7 were not going to work.

On each of the pages i have set out the script for the first four buttons. You can follow the same steps for the rest of the table and buttons.

In the script you were referencing  #subform, whihc did not exist. Making this specific to the particular page worked:

xfa.host.resetData("form1.Patienten.Table1.Row2");


xfa.host.resetData("form1.Patienten.Table1.Row3");

I have only done the first four rows.

Good luck,

Niall

View solution in original post

7 Replies

Avatar

Correct answer by
Level 10

Hi,

There are a few things going on here.

The easiest is the print button. Check out the help file for the eight parameters in the standard script. Parameter 2 sets the start page (based on a zero numbering system); the third parameter sets the finish page. So if you look at the print button on page 2 it now looks like this:

xfa.host.print(1, "1", "1", 0, 0, 0, 0, 0);

Now on page 2, the table rows were not uniquely referenced. There were a lot of Row2[*]. So script referencing Roe7 were not going to work.

On each of the pages i have set out the script for the first four buttons. You can follow the same steps for the rest of the table and buttons.

In the script you were referencing  #subform, whihc did not exist. Making this specific to the particular page worked:

xfa.host.resetData("form1.Patienten.Table1.Row2");


xfa.host.resetData("form1.Patienten.Table1.Row3");

I have only done the first four rows.

Good luck,

Niall

Avatar

Level 2

Thanks a lot!

I've seen the lot of rows, i think that i copyed the firts row, thats why there were a lot of.
The deleting button works great, i have to test the printbutton, but i think it will work.

Thanks again!

Greetz, Josh

Avatar

Level 2

I have one more question about this form. I've got a button on page 2 and 3 that says "opslaan en afsluiten" (it's dutch), this way you can close and save the document. It closes the document very good, but it doesn't close the program. How can i save and close all?

Greetz, Josh

Avatar

Level 10

Hi Josh,

I won't be able to check your form until tomorrow; however I am fairly sure that you cannot access the quit command using script.

The best you will achieve (I think) is to close the document. I don't think you can quit the application (Acrobat/Reader).

A lot of the menu items are restricted for security reasons. Here is a form which sets out the menu items that are accessible.

Good luck,

Niall

Avatar

Level 2

Hai Naill,

I tried the close script from your form, but it wouldn't work. I'm curious if you can solve it, otherwise i just have to accept that i can't stop all in one time. Your pdf looked very interesting!

Greetz, Josh

Avatar

Level 10

Hi Josh,

The closest you will get is to execute the "close" menu item, as you have it (just missing the ; at the end of the line). Accessing the "quit" menu item is not allowed.

app.execMenuItem("Close");

This will close the current document, it will not close other documents that are open in Acrobat/Reader and it will not quit the application. This works here.

Good luck,

Niall

Avatar

Level 2

Hi Naill,

It's pitty that it will not quit the application.

Thanks anyway.

Greetz, Josh