These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Checkbox.rawValue not working

Subha
Registered: May 1 2009
Posts: 11

Hi All,

I am new to this technology and struck up with the below issue. Please guide me in finding a solution.

Scenario 1 (Creating new PDF):

I had created a PDF Acro form (NOT a XFA form) using LiveCycle designer. The form has a checkbox, textfield and button. On Click of the button (Save), I am doing the below validation; This validation is working fine. In the server side, I am using a Java (Servlet) to save the PDF to FileSystem.

********************

form1.#subform[0].Button1::mouseDown - (JavaScript, both)

if(CheckBox1.rawValue == 0) {
app.alert({
cMsg: "Warning! Enter the value for Checkbox",
cTitle: "Checkbox"
});
CheckBox1.border.edge.color.value = "255,0,0";

} else {
myDoc.submitForm({
cURL: "http://localhost:9080/FDF_Examples/SavePDFAction",
cSubmitAs: "XFDF"
});

}

*********************

Scenario 2 (Editing a Saved PDF):

I opened the above saved PDF in a browser. The checkbox in the PDF is displaying as "Checked". But
when I click the button (Save), the javascript displays my validation message "Warning! Enter the value for Checkbox".

Even though the checkbox is "checked", the javascript code "CheckBox1.rawValue" is returning a value (0).

When I deselect and select again the checkbox, the javascript code "CheckBox1.rawValue" is returning a value (1).

*********************

Is there any other way to find if the checkbox is selected? Please let me know your thoughts and suggestions. Appreciate your support.

Note to moderator: I had also posted the same topic under JavaScript anticipating some kind of help.

Subha.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I'm afraid that you do have an XFA form. XFA is the underlying XML gramar that is used by a LiveCycle form. In fact thats all LiveCycle designer does, it generates XFA XML. The PDF is just a wrapper for the XFA.

if the CheckBox is checked but "CheckBox1.rawValue" is returning 1 then there is a problem with the form. This is not normal behavior. Sounds like the data model is not properly merged into the form model Try running this code after the document initialized.

xfa.form.remerge();

Your form submit does not submit the PDF file, it is sending the form data, in XFDF format to your Java Servlet. What is the Servelet sending back? XFDF is not the correct data format to be using with an XFA document, especially if it's dynamic. Submitting/recieving XFDF circumvents the data model. This combined with whatever is returned from the servlet may be corrupting the Data model so that the checkbox looked checked, but the underlying data is not.

*******************
BTW: Nobody is obligated to answer your questions. This is a free service provided by volunteers. Some get answered, some don't. Why don't you chip in and answer a few?

*****************
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Subha
Registered: May 1 2009
Posts: 11
Hi Thomp,

First I would like to thank you and all the users of this volunteer group for the continuing support. Appreciate.

To answer your question, the servlet is sending XFDF file to the browser. I set the content type as
response.setContentType("application/vnd.adobe.xfdf").

Thank you.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ahh, then this is the source of your problem. You are using a Static XFA form. Because of this, the PDF wrapper is organized very much like an AcroForm. When Acrobat recieves the XFDF data it populates the AcroForm portion of the file, completely bypassing the XFA data and form model. This AcroForm portion is used only as the viewable appearnce of the form. It is not connected to the XFA. So the form looks like it recieved data but it did not. Only the appearance changed. If you want to return data to the PDF then return XDP formatted data, or do not return any data at all. For example, return an empty XFDF.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Subha
Registered: May 1 2009
Posts: 11
Thomp,

Thanks for providing a detail explanation. I tested the same static pdf (Acroform) by adding a textfield, Selectbox and radio button through ALC.

In the edit mode (passing XFDF data from Java Sevlet), the textfield.rawValue and selectbox.rawvalue returned the value currently displayed in the form. But the radiobutton and checkbox rawvalue didn't return the value.

So it means ALC is not the tool for creating Acroforms (Static forms). Does the PDFforms created in ALC needs Adobe LiveCycle server to publish?

In previous version of Acrobat Pro(Acroform), we can create a Acroform, use FDF Toolkit to dynamically populate the fields in the Acroform. We are basically expecting the same functionality in ALC PDFforms.

Please let me know your thoughts and suggestions. It will defintely a great help for us to proceed.

Subha.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Both Acrobat and Reader (version 6 and later) load and run LiveCycle forms. No extra software needed.

You can use a server script to send data to a LC form in almost exactly the same way as you do with an AcroForm. The only difference is that the data format needs to be XDP rather than FDF.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Subha
Registered: May 1 2009
Posts: 11
Thanks for the update.

Are you referring the "PDF Utilities Service" as server side scripts? Please let me know. Is there any documentation available for writing server side scripts through which we can set the data (XDP) to LC form.

I am sorry for my repeated questions. Appreciate your help.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You could use the "PDF Utilities Service". But what I'm talking about is different. A server side script is any code that runs on a server that you can send an HTTPRequest to, ASP, ASP.NET, PHP, Perl, Java, ColdFusion, etc. As well as out-of-the-box data servers like the LiveCycle stuff or you could write your own server in C/C++ or VB. It matters not. The idea is that Acrobat sends an HTTPRequest off to an URL where the form data is processed and something is sent back to Acrobat in an HTTPResponse. If you're prepopulating LiveCycle forms then the return data should be in XDP format. Just the Datasets, not any of the other stuff. You can see an example of the format by exporting data from your form to the local disc in XDP format.

How exactly were you using the FDF toolkit? Sending data to a LiveCycle form is no different except that the data format is XDP instead of FDF.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Subha
Registered: May 1 2009
Posts: 11
Thanks Thomp. I will try changing the content type to XDP.

Appreciate and thanks for your suggestions and comments.

Subha.