cancel
Showing results for 
Search instead for 
Did you mean: 

Pin Header - List Report - Fiori

smarchesini
Active Contributor
0 Kudos

Hi experts,

I'm using the standard list report (version 1.52 of sapui5).

The question is about the pin button.

Is there a method to "save" in variants the choice taken of that button ?
Or more simply
Can I set pin button always on when I open the application ?

Thank you,

Sebastiano

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Sebastiano,

I don't think the standard Variant Managment of UI5 can handle it. But you can extend it to fit your requirement by implementing the beforeVariantSave and afterVariantSave Events of your SmartFilterBar.

You save the pin state of the page into the _CUSTOM section of the variant when a variant is saved.

onBeforeVariantSave: function (oEvent) {
   var isPinned;

   isPinned = .... // get the pin state of the page header (true/false). 

   var oSmartFilter = oEvent.getSource();
   var oData = oSmartFilter.getFilterData();
			
   oData._CUSTOM = {
      isPinned: isPinned
   };
			
   oSmartFilter.setFilterData(oData);
 },

Read the property of the state out of the _CUSTOM section and apply it the the page, when you load the variant.

onAfterVariantLoad: function (oEvent) {
  var oSmartFilter = oEvent.getSource();
  var oData = oSmartFilter.getFilterData();
  var isPinned = oData._CUSTOM.isPinned; 
			
  // now you got the state of the pin state (true/false), then set the pin state to your page. The coding here is highly depends on your page controller. 

},

I hope it could help you.