Click on any phrase to play the video from that point.
[♪music♪]
[ADOBE® LIVECYCLE® ES2]
[Adobe LiveCycle ES2: Introduction to Patterns and Formatting Field Values]
[male] LiveCycle Designer ES2 patterns specify how data is formatted
when it's displayed or entered in a form.
Common examples include telephone numbers, employee IDs,
or social security numbers.
Designer ES2 allows you to specify four types of patterns.
Display Patterns define how data is formatted when it's shown at run time.
They're applied on data after it has been loaded from an external source
or data that is displayed in a field after it has been entered.
Edit Patterns specify how existing data is formatted when a user is editing a field.
Validation Patterns are rules to ensure data is entered appropriately.
When a user finishes entering data in a field,
the value is checked to ensure it meets the Validation Pattern.
If this test fails, the user is alerted to go and reenter their data.
Data Patterns specify the format of data when it leaves the form;
for example, when it is submitted to LiveCycle Forms ES2.
You can use it to format data according to your database schema
or data model.
This tutorial uses a Warranty Replacement Form
for a kitchen supply manufacturer to demonstrate how to use patterns.
Its functionality is explained through the following use case.
Customers access the form through the company's Customer Care portal.
When a customer downloads the form, it is prepopulated with their contact information,
which the manufacturer already has in their Customer Relationship Management System.
The customer then fills out the remaining portions of the form
with information regarding their product and the issue they are experiencing.
Once the customer submits the form, the data is sent back to the LiveCycle ES2 server
for further processing, after which it will be acted upon
by a service representative.
For simplicity, this form will use sample XML data to simulate data
coming from the CRM system.
The XML file contains customer information as well as a list
of the manufacturer's products.
Here's a demo of how the customer would fill out the form.
Notice how the form is prepopulated with the customer's contact information
so they don't have to reenter it.
They're presented with an error if they enter an invalid serial number.
The customer can also enter the price as a simple decimal number
which is formatted as a currency once the field loses focus.
LiveCycle Designer ES2 comes with a number of predefined patterns
such as zip code, phone number, and social security number.
The XML data from this form contains a customer phone number
that is stored as a 10-digit number in the database.
We'll create a Display Pattern to format this number with brackets and hyphens.
The postal or zip code is also stored in the database.
It's stored as a string of numbers or a combination of numbers and letters,
depending on the customer's country.
We'll create a Variable Display Pattern that will display the value as a U.S. zip code
if the incoming value is five digits in length
or as a Canadian postal code if the incoming value is six characters in length.
Just hold down the Control key and select multiple patterns
to create what's called a Variable Pattern.
The pipe character | separates the different patterns
within the pattern's text box.
This company uses a universally-formatted nine-digit serial number
for each of its products.
The serial number is separated in three sections by a hyphen
when seen on product packaging and on online catalogs.
The serial number field needs to be validated.
If it doesn't get validated, an invalid serial number could be submitted
and would cause delays down the road when the request is being actioned
by a service rep.
We'll add Custom Display, Edit, Validation, and Data Patterns
for the serial number field.
Custom Patterns are constructed by combining characters that represent a certain type of value.
A full list of these characters is available in the Designer ES2 documentation.
For this serial number, we're using a 9 to specify that a user can enter any number in its place.
When the user edits the field, we don't want to show the hyphens.
This is the Edit Pattern.
When the user is finished editing, we want to show the hyphens.
This is the Display Pattern.
We also want to ensure that the data we submit from the form
is not hyphenated so it can be inserted properly into the database.
This is the Data Pattern.
Finally, we want to make sure that the user enters a valid 9-digit serial number.
If they do not enter a valid number, they will be presented with an error.
You can find additional validation options in the Form Validation tab
of the Form Properties dialog box.
You can specify what you want a field to display if it's assigned an empty or 0 value.
For example, if the customer database does not have a phone number for a customer,
a field can display the non-applicable abbreviation as text.
Or if the customer indicates that they paid nothing for the product in the price field,
the field can display the text complimentary.
A locale is a standard term used to identify a particular language, country, or region.
In Designer ES2, a pattern locale defines the format
of dates, times, numeric, and currency values
relevant to a specific nation or region
so that users can use the formats they are accustomed to.
If you specify a Generic Pattern,
it will be formatted according to the customer's locale.
For example, a form viewer who has set their locale as Britain
will see date and time in the British format.
Note that you can force a locale's format upon a field,
ignoring the user's system locale.
More information on this is available on the Designer ES2 documentation.


