2025 Feb 14 11:18 AM - edited 2025 Feb 14 11:24 AM
Hello Experts,
I am trying to build ListReport (Fiori Elements) using OData V4 based on CDS Views and UI Annotations.
For ListReport, I have used @ui.listItem[{position:10}] to display a column on the List.
To hide the column, I can use @ui.listItem[{position: 10, hidden: true}]. This works fine.
But I would like to set the visibility of Column based on a Variable like:
@UI.listItem[{position: 10, hidden: #(VARIABLE_NAME)}
When VARIABLE_NAME is true, the column should be hidden. But this does not work as expected.
Currently, the column is still displayed in the Table, but Value of the column is blank.
Expected Result: Whole of the Column should be Hidden.
If I pass, proper boolean value of true or false to hidden, it works as expected.
Why I am using @ui.lineItem.hidden ? - This is because, it is required to sometimes, hide the column in the list, but display on the objectPage (next page).
UI5 Versions tries: 1.108, 1.120, 1.122
Any inputs or insights can help me a lot.
Thank you.
Regards,
Avinash Ambalgi
Request clarification before answering.
Hi,
This is by design and can be seen in the note in https://sapui5.hana.ondemand.com/#/topic/c0f6592a592e47f9bb6d09900de47412:
"If the path-based value for UI.Hidden evaluates to true for all rows, then only the fields are hidden and not the entire column."
The reasoning is that if the entire column were to be hidden, it causes confusion to end user when dealing with variants. For example, if currently all the rows have no values and the column is hidden and if user saves this as a variant - what should happen when this variant is restored in a context where some of the rows have a value for this column? Suddenly bringing back the column might confuse the user who saw this variant w/o the column earlier!
Best Regards,
Sandeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @sandeep_rs for clarification and pointing out the exception.
Anyother way that you can suggest?
What I am trying is to show or hide a column based on the some factor (variable value).
Regards,
Avinash
Hi @sandeep_rs , can you please elaborate on the setPV() method? Will this be as an extension of the Fiori Element?
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.