SAP Knowledge Base Article - Public

2355197 - Understanding "UI Field Renderer"

Symptom

  • How does the "UI Field Render" option works?
  • Which render options do I have available?

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors Metadata Framework.

Reproducing the Issue

Within a MDF object, I have the chance to set "UI Field Renderer" by clicking on Details of a field to view its properties:

UIFR.JPG

Resolution

You can render the MDF AutoComplete function differently from the way MDF displays it. You can hide or show the External Code field as required. For example, when you choose a value for a Picklist or a GO from a dropdown in the Manage Data page, only the label is displayed. Previously, both the label and external code were displayed.

Field Definition has a new attribute uiFieldRenderer. It has the seam name of the class, which is used to obtain the meta and data for the field. This is populated using the Field annotation or from the UI. To implement it, extend any one of the existing default UI Renderers. You can define the UI Renderer for all data types. Note that you can do this only per field.

If the Java field defines uiFieldRenderer, you cannot remove and override it from the UI. However, if the Java field does not define the renderer, you can add it from the UI.

There is a new annotation CustomUIRenderer to mark the Renderers, which override the default behavior of MDF. This means that you must annotate the Renderers, which populate getUIComponentInfo().

Default UI Renderers are provided for all types of fields supported in MDF. See the following table:

Field Data Type

Default UI Renderer

GO

autoCompleteFieldToVO

FO

foundationAutoCompleteFieldToVO

Picklist

pickListFieldToVO

String

  • baseFieldToVO

  • fieldWithNamespaceToVO

The default value here depends on the name space.

Number or AutoNumber

baseFieldToVO

Boolean

booleanFieldToVO

Enum

enumFieldToVO

User

userFieldToVO

Date

dateFieldToVO

DateTime

dateTimeFieldToVO

Decimal

decimalFieldToVO

Attachment

attachmentFieldToVO

Clob

clobFieldToVO

Localized

localizableFieldToVO

DataSource

dataSourceFieldToVO

To hide the external code for picklists, use the displayPickListWithoutExternalCode field renderer. And if you want to hide the external code for GOs, usedisplayGOWithoutExternalCode. The name of the entered UI field renderer will be validated. Note that it must be a valid Seam name.

NOTE: Suppose that the External Name field is empty and the customer has entered the renderer to display only the name. Then the system does not display an empty or blank row in the dropdown. It displays the external code.

See Also

UI Field Renderer.

Keywords

UI Field Renderer, autoCompleteFieldToVO, foundationAutoCompleteFieldToVO, pickListFieldToVO, baseFieldToVO, fieldWithNamespaceToVO, baseFieldToVO, booleanFieldToVO, enumFieldToVO, userFieldToVO, dateFieldToVO, dateTimeFieldToVO, decimalFieldToVO, attachmentFieldToVO, clobFieldToVO, localizableFieldToVO, dataSourceFieldToVO, displayPickListWithoutExternalCode, usedisplayGOWithoutExternalCode. , KBA , LOD-SF-MDF-OBJ , Object Definitions All Object Definition Creation , Problem

Product

SAP SuccessFactors HCM Core all versions