cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Elements Object Page create mode and default values

former_member321811
Participant
0 Kudos

Hi,

I'm using a List Report template to allow users to view, edit and create some objects stored in a Z table in my backend. I'm using some properties (i.e UXHideField1) to control the visibility of some UI elements via the UI.Hidden annotation.

I'd like to hide these UI elements by default when a new entry is created. Is there a way to catch the event when the + button is pressed on the list page? Or is there a way (annotation?) to provide a default value for a boolean property or a UI.Hidden value?

Cheers,

Pierre

Accepted Solutions (0)

Answers (2)

Answers (2)

S0019221080
Explorer

Not sure if it is the best way, but I have manipulated my hidden property via t his way:

onInit: function () {
     if (this.extensionAPI) {
          this.extensionAPI.attachPageDataLoaded(this._setDefaultProperty.bind(this, 
          "property", true));
     }
},

/**
 * Setter for property
 * @param {String} sProperty, the property name
 * @param {String} sValue, the value for the property
 * @private
 */ 
_setDefaultProperty: function ( sProperty, sValue) {
	var oModel = this.getView().getModel();
	var sBindingPath = this.getView().getBindingContext().getPath();	
	oModel.setProperty(sBindingPath + "/" + sProperty, sValue);
}
pmcfarling
Participant

worked perfect. thanks

p619793
Active Participant
0 Kudos

Did you get a solution for this? I guess, the fields won't show until they are added in ABAP metadata extension or local annotation for the particular 'Reference Facet', will they?

Regards,

Sumit