Posts tagged "xfa"

Acrobat/Reader: how to display the attachment panel automatically in XFA forms

Issue

The attachment panel in Acrobat/Reader does not appear automatically, even when the document does actually contain attachments. It is a common requirement to have the attachment panel show up automatically when opening a form which contains attachments.

Solution

Use the following instructions to check for attachments in the document, and if attachments exist, then show the attachment panel.

1. you will need to edit the form in LiveCycle Designer.

2. add a Button object to the form from the standard library.

3. set the presence of the Button to “Invisible” in the Field properties of the Object Palette (on the right-hand side).

4. goto the click event of the button at the top and enter the following client-side Javascript:

var myDoc = event.target;
var d = myDoc.dataObjects;
if ( d == null ) {
// do nothing
} else {
app.execMenuItem("ShowHideFileAttachment");
}

5. then open the doc::Ready event of the form itself and enter the following client-side Javascript to call the click event of the button when opening the form:

Form.Subform.Button1.execEvent("click");

6. save the form

Note: This solution will work for Acrobat 8. If you wish to use Reader 8, then the solution above will only work if you enable the form with ReaderExtensions server.

Note: To use this solution in Acrobat/Reader 7, then you will need to change the “ShowHideFileAttachment” key to “ShowHideAttachments".

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)