From 2053e90a849170ef1cb45e341098a6c4c13e9e08 Mon Sep 17 00:00:00 2001 From: samhere06 Date: Tue, 10 Feb 2026 13:19:26 +0530 Subject: [PATCH] Fix: Error from multireference read only --- .../multi-reference-readonly.component.html | 2 +- .../multi-reference-readonly.component.ts | 27 +++++++++++++++++++ .../template/simple-table-manual/helpers.ts | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.html b/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.html index 289ff244..4e390971 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.html +++ b/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.html @@ -1,4 +1,4 @@

{{ label }}

- +
diff --git a/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.ts b/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.ts index a91c724f..88f9f791 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/multi-reference-readonly/multi-reference-readonly.component.ts @@ -4,6 +4,8 @@ import { AngularPConnectData, AngularPConnectService } from '../../../_bridge/an import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component'; interface MultiReferenceReadOnlyProps { + readonlyContextList: string; + referenceList: string; label: string; hideLabel: boolean; } @@ -21,6 +23,7 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy { angularPConnectData: AngularPConnectData = {}; configProps$: MultiReferenceReadOnlyProps; label: string; + newPConn: any; constructor(private angularPConnect: AngularPConnectService) {} @@ -49,5 +52,29 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy { updateSelf() { this.configProps$ = this.pConn$.getConfigProps() as MultiReferenceReadOnlyProps; this.label = this.configProps$.label; + + const config = (this.pConn$.getMetadata() as any)?.config; + const { referenceList, readonlyContextList } = config; + let readonlyContextObject; + if (!PCore.getAnnotationUtils().isProperty(referenceList)) { + readonlyContextObject = { + referenceList: readonlyContextList + }; + } + const hideLabel = this.configProps$.hideLabel ?? false; + this.newPConn = this.pConn$.createComponent( + { + type: 'SimpleTable', + config: { + ...config, + ...readonlyContextObject, + label: this.label, + hideLabel + } + }, + '', + 0, + {} + ); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/helpers.ts b/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/helpers.ts index 099e4f69..8f09df96 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/helpers.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/helpers.ts @@ -46,7 +46,7 @@ export const getContext = thePConn => { const pageReference = thePConn.getPageReference(); const { readonlyContextList, referenceList = readonlyContextList } = thePConn.getStateProps()?.config || thePConn.getStateProps(); - const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList; + const pageReferenceForRows = referenceList?.startsWith('.') ? `${pageReference}.${referenceList?.substring(1)}` : referenceList; const viewName = thePConn.viewName; // removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions