Skip to content

Latest commit

 

History

History
94 lines (70 loc) · 2.96 KB

configuring-fields-4b50f21.md

File metadata and controls

94 lines (70 loc) · 2.96 KB

Configuring Fields

A field can be represented in several ways.

Note:

This topic is currently only applicable to SAP Fiori elements for OData V4.

A field can react to many different annotations and render additional artifacts or information, such as showing a value help to allow users to choose a value, or showing semantic coloring to help indicate the criticality of the value it displays. A field can be rendered in many different forms and its rendering can be controlled via annotations. As for input fields, application developers can control the field editability, field help representations, and field validations ‒ to name only a few options. The subsequent topics provide detailed information about field configuration.

Input fields, like sap.m.Input or sap.m.ComboBox, have a property placeholder that defines which value is shown to users in edit mode before the users actively make any entries in these fields. You can use the UI.Placeholder annotation to define the value that is shown as a placeholder:

<Annotations Target="sap.fe.manageitems.TechnicalTestingService.LineItems/multiLineTextField">
    <Annotation Term="Common.Label" String="Test Multi Line Text Field"/>
    <Annotation Term="UI.MultiLineText" Bool="true"/>
    <Annotation Term="UI.Placeholder" String="Enter a multi line text"/>
</Annotations>

To validate currency fields without a related "value" field, use the isCurrency annotation:

Sample Code:

XML Annotation

<Annotations Target="com.c_salesordermanage_sd.SalesOrderManage/TransactionCurrency">
    <Annotation Term="Common.isCurrency" Bool="true"/>
    ...some more definition of property and/or value help...
</Annotations>

Sample Code:

ABAP CDS Annotation

No ABAP CDS annotation sample is available. Please use the local XML annotation.

Sample Code:

CAP CDS Annotation

TransactionCurrency @(
        Common         : {
               IsCurrency : true
        }
  );

To validate unit of measurement fields without a related "value" field, use the isUnit annotation:

Sample Code:

XML Annotation

<Annotations Target="com.c_salesordermanage_sd.SalesOrderManage/DocumentUnit">
    <Annotation Term="Common.isUnit" Bool="true"/>
    ...some more definition of property and/or value help...
</Annotations>

Sample Code:

ABAP CDS Annotation

No ABAP CDS annotation sample is available. Please use the local XML annotation.

Sample Code:

CAP CDS Annotation

DocumentUnit @(
        Common         : {
               IsUnit : true
        }
);