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
BedrockMission!

Learn More

View all

Sign in to view all badges

xfa.host.messageBox(xfa.layout.page(this)); not working (JavaScript)

Avatar

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile
dpz_
Level 1

04-03-2016

Hi,

i am setting this.rawValue = xfa.layout.page(this); in layout:ready Event. This is working fine.

But when i am trying to send the page no to a messageBox in the same Event like this:

xfa.host.messageBox(xfa.layout.page(this));

nothing happens. Why?

Regards

dpz

Accepted Solutions (0)

Answers (6)

Answers (6)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

05-03-2016

Hi,

Not sure what to suggest, works for me.  Maybe add a button and try the click event.

Bruce

Avatar

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile
dpz_
Level 1

05-03-2016

I tried:

data::initialize - (JavaScript, client)

console.show();

console.println("Init");

But still no console 😞

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

05-03-2016

Hi,

Yes, having Acrobat makes debugging a lot easier, Ctrl-J will only work in Acrobat, but you should still be able to see the console in reader with the console.show() method.  There are a lot of JavaScript objects available in Reader that are not part of the XFA methods you get method completion support for in Designer, have a look at this link http://help.adobe.com/livedocs/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?h...

Regards

Bruce

Avatar

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile
dpz_
Level 1

05-03-2016

I could remove the warnings:

- activating or deactivating of Acrobat JavaScript Console in not possible in target version. Targetversion Reader 10.0 Code 3302

- activating or deactivating of Acrobat JavaScript Debugger in not possible in target version. Targetversion Reader 10.0 Code 3301

by setting Target Version to 10 or higher in form preferences.

But still no console available 😞 Do i need Adobe Reader Pro?

Avatar

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
dpz_
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
View profile
dpz_
Level 1

05-03-2016

Thanks for your answer. toString() works with messageBox.

I would like to use the console too.

I am Using LiveCycle Designer 11.0.1.20150701.2.920171 and Adobe Reader DC 15.010.20059. I Enabled Console for Javascript for Messages in the Reader. But when i hit CTRL + J in Reader nothing happens.

In LiveCycle Designer i get these warnings:

- activating or deactivating of Acrobat JavaScript Console in not possible in target version. Targetversion Reader 10.0 Code 3302

- activating or deactivating of Acrobat JavaScript Debugger in not possible in target version. Targetversion Reader 10.0 Code 3301

It seems that i have issues with my adobe software. LiveCycle does not know the console keyword. When i type console. i do not get a selection of keywords to complete the command.

Any Idea?

Regards

dpz

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

04-03-2016

Hi,

The messageBox() method takes a string, the XFA methods don't seem to convert types like you would expect in JavaScript, so try

xfa.host.messageBox(xfa.layout.page(this).toString());

This would have caused an exception,  "Argument mismatch in property or function argument", you should make sure you have "Show console on errors and messages" selected in Acrobat (under Edit... Preferences...JavaScript).

Also there is a console.println() method which might be easier to use than having to click on a lot of message boxes, use Ctrl-J to show the console (or the console.show() method).

Regards

Bruce