Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic hiding/showing columns with OData V2 and CDS Annotations #67

Closed
harelyshau opened this issue Jul 25, 2023 · 13 comments
Closed

Dynamic hiding/showing columns with OData V2 and CDS Annotations #67

harelyshau opened this issue Jul 25, 2023 · 13 comments
Assignees
Labels
not-doc-issue Reported issue is not a documentation issue. SAP Fiori elements type/content-gaps Something essential is missing in the documentation.

Comments

@harelyshau
Copy link

harelyshau commented Jul 25, 2023

Issue description

Hello.

I am using odata v2 with adapter from v4 (because we are using CAP Model). And I see in your documentation this example to dynamically show/hide coulmns in table.

DataField Records in Tables

To hide table columns, the UI.Hidden path needs to refer to the property of the header instance, for example:

In the following example, STTA_C_MP_Product is the entity set of the object page header and STTA_C_MP_ProductText is the entity set of the smart table on the object page, and to_Product is the navigation property from STTA_C_MP_ProductText to STTA_C_MP_Product.

But I am using cds annotations and trying to do the same. But there is no some affect when I put it in LineItems Annotation. It works well in FieldGroup, but not in LineItems.

My question: how I can make dynamic visible of columns with OData V2 and cds annotations?

image image image image

Feedback Type (Optional)

clarity

Page Title on SAP Help Portal (prefilled)

Additional Features in SAP Fiori Elements for OData V2 DataField Records in Tables

Page URL on SAP Help Portal (prefilled)

https://sapui5.hana.ondemand.com/sdk/#/topic/ca00ee45fe344a73998f482cb2e669bb.html

@harelyshau harelyshau changed the title [doc issue] Dynamic hiding/showing columns with OData V2 and CDS Annotations Jul 25, 2023
@KvM2
Copy link
Contributor

KvM2 commented Jul 25, 2023

Hi @harelyshau , thanks for your contribution. We appreciate it and will look into this.

@ArunBharathiKumarasamy
Copy link

@harelyshau : The property isHidden is associated via the navigation property 'Parent' to the PO Lines. So an association set describing the same (POLines to Parent) should be available in the metadata along with the Parent to POlines association.
If possible could you please share your project so that we can check and respond ?

@harelyshau
Copy link
Author

@harelyshau : The property isHidden is associated via the navigation property 'Parent' to the PO Lines. So an association set describing the same (POLines to Parent) should be available in the metadata along with the Parent to POlines association. If possible could you please share your project so that we can check and respond ?

Hello!

Unfortunately, I can't provide you this code right now, I can try to make a simplified version a little later and give you access to it.

However, I want to note that in the screenshots I provided the annotations that I use and they show that Parent.isHidden is successfully obtained and displayed in the column near.

I would be happy with at least one working example of dynamically hiding an entire column using some field in the parent entity with OData V2 and CDS Annotations. Do you have one?

@ArunBharathiKumarasamy
Copy link

ArunBharathiKumarasamy commented Jul 27, 2023

@harelyshau : The property isHidden is associated via the navigation property 'Parent' to the PO Lines. So an association set describing the same (POLines to Parent) should be available in the metadata along with the Parent to POlines association. If possible could you please share your project so that we can check and respond ?

Hello!

Unfortunately, I can't provide you this code right now, I can try to make a simplified version a little later and give you access to it.

However, I want to note that in the screenshots I provided the annotations that I use and they show that Parent.isHidden is successfully obtained and displayed in the column near.

I would be happy with at least one working example of dynamically hiding an entire column using some field in the parent entity with OData V2 and CDS Annotations. Do you have one?

Please check this example where the column 'Sub-Property 2' can be hidden based on the header property 'Hide subProperty column'.
https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/flpSandbox.html#Demo-ObjectPagePathSupport&/?sap-iapp-state=TAS2NH2B5OK2FWOA7SERMKD6GR4D9TKKN5RRH8NEV&sap-iapp-state--history=TASKFLOD13D8G3QNAJ5QABYDFO4A6VAHRFHFRG07R

@harelyshau
Copy link
Author

Thanks for quick answer.
As I see you use here XML Annotations. And my question was about CDS.

If I'm wrong could you provide me your annotations.cds file (or another named file where you made this settings).

@harelyshau
Copy link
Author

@ArunBharathiKumarasamy do you have any updates?

@ArunBharathiKumarasamy
Copy link

@ArunBharathiKumarasamy do you have any updates?

For SAP Fiori elements implementation related queries kindly post here https://answers.sap.com/tags/ed5c1ef6-932f-4c19-b2ba-1be375109ff5

@mishuagrawal
Copy link
Contributor

Hello @harelyshau,

Is your concern addressed now? Can I close this issue as well as #68 (comment) this one? I feel they both are similar.

Please do let me know.

Thanks and regards,
Mishu Agrawal

@mishuagrawal
Copy link
Contributor

Hello @harelyshau,

Can you please confirm if your concern is resolved?

Thanks and regards,
Mishu Agrawal

@harelyshau
Copy link
Author

https://answers.sap.com/tags/ed5c1ef6-932f-4c19-b2ba-1be375109ff5

@ArunBharathiKumarasamy can you answer which annotations do you use in example that you provided. I'm interested in CDS annnotations and OData v2 as you can see in title of issue?

I will check the link that you attached but I've not found this solution so far.

@harelyshau
Copy link
Author

For SAP Fiori elements implementation related queries kindly post here https://answers.sap.com/tags/ed5c1ef6-932f-4c19-b2ba-1be375109ff5

Hello @mishuagrawal. I don't think so. I've not got any example with stack that I described (OData V2 & CDS Annotations). And another issue that you attached doesn't link with this one. It's really another question.

@ArunBharathiKumarasamy
Copy link

For SAP Fiori elements implementation related queries kindly post here https://answers.sap.com/tags/ed5c1ef6-932f-4c19-b2ba-1be375109ff5

Hello @mishuagrawal. I don't think so. I've not got any example with stack that I described (OData V2 & CDS Annotations). And another issue that you attached doesn't link with this one. It's really another question.

The annotation that you have mentioned here should work and I anticipate the problem is with the missing association to the parent. To analyze the issue further please post the query in "https://answers.sap.com/tags/ed5c1ef6-932f-4c19-b2ba-1be375109ff5".

@harelyshau
Copy link
Author

Hello.

Your colleague has already helped me. Issue was in our data model. I wrote wrong Association relationship between Parent and Child entities. So if anyone else faces with similar problem, don't forger about using $self in condition of Association (if you use SAP CAP).

Thanks for support.

@OlMue OlMue added invalid This doesn't seem right type/content-gaps Something essential is missing in the documentation. labels Nov 22, 2023
@OlMue OlMue added not-doc-issue Reported issue is not a documentation issue. and removed invalid This doesn't seem right labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-doc-issue Reported issue is not a documentation issue. SAP Fiori elements type/content-gaps Something essential is missing in the documentation.
Projects
None yet
Development

No branches or pull requests

5 participants