Spell Check Locale Mapping

Following a customer request, we’ve added a new mini feature to Spell Checking in Designer.  At the moment, Designer supports spell check for about 35 different locales.  Before the magic of locale mapping, if your locale wasn’t on the list, your were essentially out of luck; even if your locale was, for all practical purposes, identical, to a supported locale.

Let me provide an example of customer pain. 

Say you’re Australian.  Aussie English is actually quite similar to Canadian English.  However, if you set your form’s locale to en_AU, you’ll get cute little warning icons telling you that spell check doesn’t support en_AU.  And you’ll sit there fulminating, thinking “Geez!  Aussie English is *practically* Canadian English!  Why can’t this stupid program just use the Canadian English settings for spell check?!”

Of course, you could get around this limitation by, say, setting your form to en_CA, doing the spell check, and then changing it back – but that’s a real pain.

Now there’s a better, easier, way.

There’s now a new file, SpellCheckLocaleMapping.xml, that is created in each user’s Designer data directory (under …\Users\your_username\AppData\Adobe\Designer\8.x).  In this XML file, users can add entries that tell Designer to use alternate locales for spell checking.

The file looks like this:

<LocaleMap>

<!– In order to map spell check locales, add an entry for each locale to map:

<Map locale=”en_AU” to=”en_CA”/>

Where “locale” is a locale which does not support spell check and “to” is the locale that will be used to perform spell check on nodes who’s locale matches “locale”.
–>

</LocaleMap>

You can just copy/paste the <Map …/> line so that it’s not in the comments anymore.  Then set the “locale” and “to” attributes.  You need to restart Designer for changes in this file to take effect.

This feature is available in Designer 8.1 and later. There’s no UI in Designer for this feature.

FormCalc Syntax Error Tips

FormCalc has a few possible syntax errors, and they aren’t always easy to decipher. Here’s a tip for when you get the “Syntax error near token ‘%1′ on line %2, column %3.”:

Generally, %1 will contain the token (word) nearest to the error. Please note that the token is not necessarily incorrect, and does not necessarily have anything to do with the error, other than proximity to the problem.

var b = abc(1)
if (b ne 1) then
//comment

The script above will generate a 7008 error: “Syntax error near token ‘then’ on line on line x, column y.” The actual error in this case is that the ‘endif’ token is missing from the script. The last correct token is ‘then’ (comments do not count as tokens.)

The way to fix this problem would be to add an ‘endif’ statement to the end of the script.

Learning Resources is putting together more extensive documentation for the syntax error messages which will hopefully be available on the Web shortly after we ship 8.2.

A Shortcut for Inserting SOM Expressions into your Script

The XFA scripting model can be a bit… overwhelming… sometimes.  It can be hard to figure out what SOM expression you need need to use.  But there is an alternative to typing out a long, many-layered-SOM-expression.  While typing in the script editor, if you hold down the CTRL key and click on an object on the canvas, the object’s SOM expression will be inserted into your script.  The SOM expression will be relative to the object hosting the script. 

If you want the absolute SOM, then hold down CTRL+SHIFT and click on the object.

Please note that this trick only works when clicking on objects on the canvas, not in the hierarchy dialog.

xfa.host.setFocus()

Did you know that starting with version 8.1, the setFocus() method can accept either a SOM expression or a node object?

For example,

xfa.host.setFocus(this);

xfa.host.setFocus(this.somExpression);

Welcome to Designer Exposed

Welcome to the LiveCycle Designer Team’s “team blog”. A place where we’ll post useful tips on how to use Designer, in-depth articles about new features, etc. We hope this will enhance the user forums (at www.adobeforums.com) and gives our developers an opportunity to provide “from the trenches” information about the product.

While we plan to post articles here, please continue to use the Forums for questions (and for suggestions about future topics for this blog). When we post an article here, we’ll link to it from any relevant questions in the Forum.

LiveCycle Designer Team