Creating a Time and Date Format for Business Components Attributes

You can create a date and time format (display both) to display an ADF Business Components attribute value that is SQLType DATE, but you must first change the attribute type definition on the attribute's entity object to Timestamp.

To change the attribute's type:

  1. Expand the Business Components Model project in the Application Navigator and locate the entity object that defines the attribute for which you want to create the format.
  2. Right-click the entity object in the Application Navigator and choose Edit EOName.
  3. In the Create Entity Object wizard, select Attribute Settings and select the desired attribute from the Select Attribute dropdown list.

    Note: By default the attribute should show a type of Date to match its database column type.

  4. Select Timestamp from Type on the attribute settings page.
  5. Click OK to save the attribute with the new type.

To format an attribute with both date and time:

  1. Open the Create Attribute wizard for the attribute and select Control Hints.
  2. Select Simple Date from Format Type on the control hints page.
  3. Edit Format to use the desired date and time format. For example:

    dd-MM-yyyy hh:mm:ss

  4. Decide whether you want the user to edit the field directly or supply the date from a Calendar picker. Select the appropriate Control Type on the control hints page:
  5. Click OK to save the attribute with the new type.

You can bind your ADF-enabled components to the Business Components attribute to display the formatted value.

In the case of an ADF UIX page, the date pattern you specify for a UIX component (such as messageDateField) must match the date formatting specified in the control hint. If you don't use the same pattern, you will get a runtime error.


About Control Hints for Business Components Clients

 

Copyright © 1997, 2004, Oracle. All rights reserved.