Can't add parentId or rootId to ListingView

I am defining a new listingview that needs to display rootId/parentId as part of UI view. When I try to add rootId to my listingview, I am getting the following exception:

Caused by: java.lang.IllegalArgumentException: Column prop names [parentId] are not valid for the associated type.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142)
at com.leidos.leaf.listingview.service.validation.ListingViewValidationService.lambda$doValidate$2(ListingViewValidationService.java:103)

Are there any restricted properties that are not accessible in listingviews? If not, how to get rootId added to the listingview?

Hey there! I believe in your BeanMetadata, you need to override ParentIdFieldMetadata to be “columnViewable”=true, if you want it to be legal for use within ListingViews.

Here’s an example for how to do that with XML.

<ParentIdField propName="parentId" columnViewable="true" propsToOverride="columnViewable" />

And that would just go inside your BeanMetadata’s <type type="..."></type> tags. Also you would just repeat the process for rootId, like this:

<RootIdField propName="rootId" columnViewable="true" propsToOverride="columnViewable" />

Let me know if this works for you or if you need help with a different format (JSON/YAML/Java/JS/etc.).

2 Likes

I think by default most if not all system fields are not columnViewable, and that’s something you need to opt into.

It worked! Thanks for the quick response Mark.

1 Like

Awesome and not a problem!