since ‎27-10-2008
‎10-12-2019
JohnBrinkman
Level 2
Re: xfa.log.message(...) gone in ES2?
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
The xfa.log object is still around -- but it exists only when executing in the context of the server. In acrobat if you check typeof xfa.log it will tell you "undefined".Server-scripts will run in Designer under certain circumstances. It depends on the kind of file you're saving:- save-as XDP: no script will run.- save-as static PDF: all scripts will run- save-as dynamic PDF: only scripts marked to run-at server will execute (scripts marked runat "client and server" do not execute)Some of this i...

Views

194

Likes

0

Replies

0
Re: Control over submitted XML data
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
When you define your form using a schema or sample XML, you get the opportunity to "Transform outgoing data" by specifying an XSLT script.When you provide a script here, it will execute against your data before it is submitted.Your other option is to bypass the submit processing and use FormCalcs put/post methods to explicitly format your message. John

Views

112

Likes

0

Replies

0
Re: How to allow Drop Down listbox to accept null values/no value
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
You can have an entry in the list to represent no value ("").Then you can add an exit script that looks like:if (this.rawValue === "") { this.rawValue = null;}This way, when the user selects the "" entry, the value will be set to null when they exit the field. John

Views

114

Likes

0

Replies

0
Re: Restrict text field from keying certain characters by user
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
You can restrict user input by modifying xfa.event.change during the change event.To remove the characters you mention, try this script:xfa.event.change = xfa.event.change.replace(/[\"\\[:;

Views

168

Likes

0

Replies

0
Re: Check if field validation passed (isValid?)
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
A couple of late comments here:If you want to see if a date field matches a pattern you can:a) Add a display pattern for the fieldb) The field will be valid if:field.rawValue != field.formattedValueThe reason this works is because if a field cannot be formatted with a picture clause, the formatted value will be the same as the raw value.There's more help coming:In acrobat 9.1 (XFA 3.0) there are new properties to determine if a field is valid.You can call subform.getInvalidObjects() for a list o...

Views

618

Likes

0

Replies

0
Re: Where is "Form locale" looked up from??
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Locale definitions are also stored inside the XFA definition. You can see them if you go into XML Source view and search for: "localeSet".The localeset will embed the ambient locale of the form designer's system, and will also embed all locales referenced by the form.So if you want to guarantee that the Danish locale gets embedded, then create at least one object on your form that explicitly uses that locale.Also bear in mind that once a form with an ambient locale is opened and saved, the local...

Views

556

Likes

0

Replies

0
Re: Image Linking - Can it be done w/o embedding
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
You cannot have linked images in a PDF (well, technically, the PDF spec allows it, but Adobe products won't generate this variation of PDF).Among the reasons:a) With a linked image the document is no longer portable (the 'P' in PDF)b) With a linked image, you cannot reliably sign a PDF, since the referenced image could changeThe linking/embedding option you see in Designer applies to whether the image is embedded in the template.When the PDF is generated from the template, any linked images will...

Views

94

Likes

0

Replies

0
Re: Image Field Name Display
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
If the image was added in Designer, the image name gets saved under the element.The file name can then be displayed with the expression:ImageField1.desc.embeddedHref.valueAs Paul says, if the image field were updated in Acrobat, the desc element does not get updated.Updating the image field desc element in Acrobat would be a nice enhancement request. John

Views

126

Likes

0

Replies

0
Re: Limit the input in a numeric field
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
If you want to swallow all keystrokes after you've reached 10 characters, then clear the xfa.event.change property:if (xfa.event.newText.length > 10) xfa.event.change = "";John Brinkmanhttp://blogs.adobe.com/formfeed

Views

415

Likes

0

Replies

0
Re: Validation pattern for 4 digit number
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
You could use a text picture instead of a numeric picture:text{9999} will enforce that all 4 digits are supplied.(Designer will give you a warning if it is a numeric field, but you can ignore the warning) John Brinkman http://blogs.adobe.com/formfeed

Views

307

Likes

0

Replies

0
Re: drop-down list formattedValue returning value, not text
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Tom:It's possible, but complicated. You need to look into the field definition where we store the listbox contents. Then you can correlate the display item from the bound item. I've done this before in another context. I've appended the script I used. John Brinkmanhttp://blogs.adobe.com/formfeedfunction getDisplayValue(vField){ var vBoundItems = saveItems(vField); var vDisplayItems = dispItems(vField); if (vBoundItems == null || vDisplayItems == null) return vField.rawValue; for (var i=0; i aaa ...

Views

780

Likes

0

Replies

0
Re: How to find out if a pattern validation failed
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Edgar:Instead of using a validation picture, you could put the logic in a FormCalc validation script and use the format() method. Then if it fails you can clear the field and setFocus() back into the field.Alternatively, you could use a display picture and your validation script could compare rawValue with formattedValue. If a display picture fails, then rawValue and formattedValue will be the same.I've described this in more detail (with a sample) at:http://blogs.adobe.com/formfeed/2009/02/call...

Views

149

Likes

0

Replies

0
Re: "xfa.data.nodes.remove" wreaking havoc on dynamic forms
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
I have posted a blog entry with a sample that includes a debugging tool -- a subform that displays the contents of the form dom and data dom and the relationships between them.Have a look at:http://blogs.adobe.com/formfeed/2009/02/form_dom_debugging_tool.html John Brinkman

Views

237

Likes

0

Replies

0
Re: Preventing Form Calc Runtime Error Message Dialog
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Duarte:You cannot catch exceptions in FormCalc -- it doesn't have that language feature. If this is important to you, you need to stay with JavaScript. Of course there are certain functions that are available only in FormCalc. There is a way to get at those functions from JavaScript. See my blog post at:http://blogs.adobe.com/formfeed/2009/02/calling_formcalc_functions_fro.html John

Views

135

Likes

0

Replies

0
Re: How to know the target XFA Version of a form with JavaScript
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Duarte:I have a blog entry that discussed target version and original version. It also has a sample that shows how you can extract these versions from a form at runtime.http://blogs.adobe.com/formfeed/2009/02/form_compatibility.html John

Views

158

Likes

0

Replies

0
Re: Remove all instances of a subform
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Ian:It looks like you're not constructing a proper reference to your instance manager. The easy way to do it is to prefix the subform name with an "_". e.g. if your subform is named "detailLine", then the instance manager will be named "_detailLine".To remove all instances, code:_detailLine.count = 0;(No need to use a loop).If you want to selectively delete subform instances, then reference _detailLine.removeInstance() in a loop. John http://blogs.adobe.com/formfeed/

Views

274

Likes

0

Replies

0
Re: Alternating Table Rows - Complex tables
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Try this:1. Wrap your main row and indented row in a subformSet.2. Mark the subformSet as repeating3. Mark your main row and indented row subforms as "not repeating"4. Make sure your subformSet type is: "select one subform from alternatives" John http://blogs.adobe.com/formfeed/

Views

119

Likes

0

Replies

0
Re: Field validation patterns - how sophisticated ? -
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Bill:It might have been this blog entry:http://blogs.adobe.com/formfeed/2008/10/numeric_constraint_no_zeros_2.htmlThe answer is to use a picture clause such as:zero{'n/a'}|num{$zzzz9.99} John

Views

188

Likes

0

Replies

0
Re: Remove all instances of a subform
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
Actually, it's even a bit easier than that. The count property on the instance manager is read/write. To remove all instances of a subform you can code:instanceManager.count = 0; John http://blogs.adobe.com/formfeed/

Views

274

Likes

0

Replies

0
Re: Focus after validation error
Avatar

JohnBrinkman

JohnBrinkman
- Adobe LiveCycle
The easiest way to convert a picture validation to a script validation is to use the formcalc format() function.E.g. the formcalc script to validate a US zip code would look like:format("text{99999}", $) <> ""

Views

139

Likes

0

Replies

0