Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Declaring formatters is similar to declaring data sources.  The following example shows a formatter:

Code Block
<formatter id=

...

"customers" 
 class=

...

"com.nexaweb.plugin.data.formatter.

...

MessageFormatter" 
 format="There are {0} customers in the database"/>

...

The following table describes the ways you can define your own formatters: 

...

For more information on defining your own formatters, see Creating a Formatter.

In addition, Nexaweb provides the following formatter tags for transforming data for display in a UI:

...

For more information on pre-defined formatters, see Supplied Tags.

Note: Nexaweb does not provide validation to suit all needs.  For example, Nexaweb does not provide formatters for state abbreviations, postal codes, phone numbers, and so forth.  However, Nexaweb provides a formatter tag to enable you to easily create formatters that provide these features.

...

Supplied Formatter Tags

Nexaweb provides the formatter tags described on this page.

...

The formatterChain tag defines a chain of formatters where the output of one formatter becomes the input to the next formatter in the chain. You can use this tag anywhere you can use a regular format.  In the following example of a fomatter chain, myStringToDateFormatter, myDateFormatter and myMessageFormatter represent id attributes of the previously defined formatters:

Code Block
<formatterChain id="myChain">
   <formatterReference formatter="myStringToDateFormatter/>
   <formatterReference formatter="myDateFormatter" />
   <formatterReference formatter="myMessageFormatter" />
</formatterChain>

...

 

The formatterChain tag uses the ID attribute only.  The ID tag uniquely identifies this messageFormatter using a system wide unique value. The formatterChain tag can use the formatterReference element as a child.

...

 In addition, developers may elect to create their own formatter tag definitions.