Portlet Factory, Version 6.1.2


 

Formatted Text builder

Use the Formatted Text builder to format values for display on a page. The Formatted text builder produces uniform formatting of dates and numbers. A typical use case for this builder is when you want to display a value as currency or as a date. You can also opt to make the displayed value editable. In this case, the value is presented within a text input box from which you can retrieve data.

This builder uses Java's MessageFormat and SimpleDateFormat classes to convert user input to appropriate formats. This conversion occurs at runtime, and the following conversion formats are supported:

  • Supported number formats include:

    • Currency – $987,654.00

    • Percentages – 98%

  • Supported date input formats include:

    • E MMM dd yyyy hh:mma – Thu Dec 13 1962 12:00AM

    • MMM dd yyyy hh:mma – Dec 13 1962 12:00AM

    • yyyy-MM-dd HH:mm:ss – 1962-12-13 12:00:00

    • long – 48923332

  • Supported Date Output formats include:

    • E MMM dd yyyy hh:mma – Thu Dec 13 1962 12:00AM

    • MMM dd yyyy hh:mma – Dec 13 1962 12:00AM

    • yyyy-MM-dd HH:mm:ss – 1962-12-13 12:00:00

When working with dates, choose an input format. That format must be strictly adhered to when a date value is entered. If the date value is entered incorrectly, it will not be converted to the output format you have selected.

When working with percent, enter a decimal value to represent a percent less than 100%.

You can customize the input and output date formats to add more supported date formats.

Parent topic: Builder help


Library | Support |