Button over rides prePrint event

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

11-10-2018

Is it possible for a button, on the click event, to over ride a prePrint event?

I have a form that on prePrint event, a page's presence is hidden, so that not even a blank page is printed.

Now I need a button that over rides that   this.presence = "hidden";  command.

Is there a tag to call out?

something like, on click event:

this.prePrint().presence = "visible";

xfa.host.print(1, "0", (xfa.host.numPages-1.toString().....

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

15-10-2018

I just tried it with the script below and it worked. I provided a name for the page "Page2" not sure that really matters as long as you use the correct name for the page.

if(CheckBox1.rawValue == "on"){

Page2.presence = "hidden"

}

Remember on the post print action you will need to make the page visible again:

Page2.presence = "visible"

Answers (7)

Answers (7)

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

12-10-2018

you could do that. You could have a hidden field with a value 0 or 1. Add a check box asking if the user wants the page printed if they click yes then the pre-print script is modified to turn on the page, else its off.

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

15-10-2018

this is why we shouldn't work late at night... syntax error

Need to remember == means equal rather than just =

mouslander, thank you for double checking!

things work as they should be. All is right with the world again.

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

15-10-2018

Well this is strange...

I placed a checkbox field on the page(that hides during print). if I check it, it should allow the page to print.

in the prePrint event for the root sub page, I wrote:

this.presence = "hidden";

if(checkbox.rawValue = "1")

{

this.presence ="visible";

}

when I click "print" without checking anything thing the page shows up.

When I look back, the check box is checked!

I tried:

if(checkbox.rawValue = "0")

{

this.presence ="hidden";

}

if(checkbox.rawValue = "1")

{

this.presence = "visible"

}

same result.

I tried with if...else

same.

It seems that Livecycle is forcing the page to be visible!

Any ideas?!

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

12-10-2018

Originally, the client wanted a instruction page to be screen only and completely non-printing(not even a blank page).

So I set hidden in prePrint and visible in postPrint.

Now, they are thinking that maybe there should be a button that allows the user to print the page if they really really want to.

So I though I need an override button would be the trick.

Now I'm thinking set the prePrint event with a statement.. if something is true then hidden, else visible...

and that button trigger a value then the print function.

what does everyone think? (not in the office today to try this out)

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

12-10-2018

That would work in some situations where you just do not want something to print like a button However if the situation is that you do not want to print the page if a user hasn't entered any data then it wont work.

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

12-10-2018

If you don't want an object to be printed, you can configure it in the object palette to be visible to the screen only.

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

12-10-2018

why would you have a preprint that you would need to overwrite? Do you want to reverse the hidden state after printing? If so you could do this on the post print event.