Skip to content

Field View PropertyValue always a string #145

Open
@jhershey-marceldigital

Description

@jhershey-marceldigital

Describe the bug
The PropertyValue field of the FieldViewContext model is always a string. I expect to be able to use pattern matching/casting to get the typed value, or for documentation (here) to indicate that PropertyValue will come through as a string.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Add non-string fields to a List View configuration and invoke SetView.
collectionConfiguration.ListView(listViewConfig => {
    // field type is DateTimeOffset
    listViewConfig.AddField(x => x.StartEffectiveDate).SetHeading("#agencyProduct_startEffectiveDate").SetView("DateOnly");
    // field type is a custom entity, "Role"
    listViewConfig.AddField(x => x.Role).SetHeading("#agencyProduct_role").SetView("AgencyRole");
});
  1. Invoke GetType() on the PropertyValue field within a custom Field View/

Image

Environment (please complete the following information):

  • Server OS: Windows
  • Browser: Chrome
  • Umbraco Version: 15.3.0
  • Product Version: 15.1.2

This item has been added to our backlog AB#51757

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions