Expand my Community achievements bar.

Why won't my buttons work?

Avatar

Level 2

I am really embarassed to ask this question, but I simply cannot get my buttons to work.

  • I'm working in LiveCycle 10.4.2 / SAP OEM
  • I have set my form to be dynamic.
  • I'm targeting Reader v 9 or higher.

I added a button called "Click Me!"

I added the following script:

data.JP_Page1.sub_MentorAddress.Button1::click - (JavaScript, client)

alert ("Hello World");

When I preview or test the form in my dev environment (i.e., with data merged, saved as a PDF, and opened on my local machine), the cursor changes to an I-beam over the button and I cannot click the button as I would expect to.

I thought that maybe there were security issues related to raising an alert from a PDF, so I also tried to set the value of a text field on click, but that did not work, either. I've tried both FormCalc and JavaScript. No go.

I must be missing some basic setting, and I cannot figure out what it is.

Any ideas would be very much appreciated.

Thanks!

5 Replies

Avatar

Level 10

Hi,

In the Adobe Reader environment you will need to use app.alert("Hello World").  However if you form was getting that far you should have seen the JavaScript console come up with a "alert is not defined" message.

Because you are getting an I beam mouse pointer makes me wonder if your button doesn't have its access set to protected or readonly.  You could check by looking in the XML Source or temporarily changing it to a text field.  The access property can't be set in the Designer UI for a button.

Regards

Bruce

Avatar

Level 2

Thank you for the response, Bruce,

I switched the script to app.alert("Hello World")

I also tested using a field set to "User Entered - Optional"

Both gave me the i-beam cursor on hover, and no response when clicked.

I looked at the XML for the button and couldn't see anything that was setting it to read only or protected.

However--I just noticed that I was able to add a comment-stickie on the document when I opened it in Reader.

If the form is dynamic, I should not be able to do that, right?

This form started as a static form, then I changed it to a Dynamic XML Form using the Form Properties > Server > Default PDF Render Format: Dynamic XML Form selection.

Is that the correct procedure to switch a form from Static to Dynamic?

Is that the problem with the button?

Avatar

Level 2

A little more info:

I got the button to work in PDF Preview mode by setting the form to preview in Interactive Mode. Yay!!

(Form Properties > Preview > Preview Type: Interactive Form).

However, when I rendered and saved the form, the button did not work. Sad.

Avatar

Level 10

Hi,

That seems strange, is it possible you can post a link to your form in this thread?

Bruce

Avatar

Level 2

Alas, I cannot link to the file. In the SAP OEM version of LC, the files are buried deep within the SAP database.

Thanks for trying to help.