on 2021 Aug 10 11:02 AM
Hi Experts,
I am working on SAP Fiori Element List Report app with Grid Table that uses an OData v2 service. We have column personalization button on the table. Currently the line item fields mentioned in UI.Annotations renders the default view and rest of the fields moved to the personalization button. We have a requirements as below
<Annotation Term="UI.LineItem">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="field1"/>
<Annotation Term="UI.Hidden" Bool="true"/>
</Record>
</Collection>
</Annotation>
2. We have to make couple fields(columns) has mandatory to display in table all the time, so how we can restrict the user to unselect those fields from the column personalization.
Please someone suggest how to achieve this.
SAP UI5 version: 1.71.29
Please do let me know, if you need any more details.
Regards,
Sai Nithesh
Request clarification before answering.
Hi,
If someone is still looking for the answer to that question, here it is :
you need to use the UI.Hidden term in a seperate annotation, not in the lineitem one, because otherwise it wants to add the field to the table...
So it would give something like that :
<Annotations Target="YourODataService.YourEntitySet/field1"
<Annotation Term="UI.Hidden" Bool="true"/>
</Annotations>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
For requirement 1 to not show certain fields on the smart table personalization dialog please check the settings 'ignoreFromPersonalisation' here: https://sapui5.hana.ondemand.com/1.71.46/#/api/sap.ui.comp.smarttable.SmartTable/controlProperties
And currently using SAP Visual Editor you can edit this property and add the field names in the requested format (CSV).
Thanks,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Can you check with UI.HiddenFilter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The UI.Hidden completely hides the field from the UI, including the Object Page etc. as well.
The second approach mentioned is for freestyle applications including a SmartTable, not Fiori Element list report combined with annotations.
I was able to combine both solutions to a programmatic approach in a controller extension for the OData v2 FE List Report:
sap.ui.controller("<appId>.ext.controller.ListReportExt", {
/**
* View initialization
*/
onInit: function () {
// Hide virtual fields
// With v4 FE this approach would work: https://answers.sap.com/questions/13412687/hide-fields-in-column-personalization-button-of-fi.html
let smartTable = this.getView().byId("listReport");
if (smartTable && smartTable.getMetadata().getName() === 'sap.ui.comp.smarttable.SmartTable') {
smartTable.setIgnoredFields("EquipmentVirtual,FunctionalLocationVirtual");
}
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found this blog post, I am however not sure how much this still applies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
54 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.