I am trying to display an odata property of edm.time type in an UI5 form input field . View code
<Input id="id1" placeholder="Enter value" value="{ path: 'START_TIME', mode: 'sap.ui.model.BindingMode.OneWay' }" width="500%" editable="false"/>
START_TIME is a property of the entity
Controller code-
onInit: function () {
var model= new sap.ui.model.odata.v2.ODataModel("<xsodata url>");
model.setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);
this.getView().setModel(model);
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.getRoute("<pattern_name>").attachMatched(this._onObjectMatched, this);
},
_onObjectMatched: function (oEvent) {
var oArgs, oView;
oArgs = oEvent.getParameter("arguments");
oView = this.getView();
oView.bindElement({
path : "/" + oArgs.objPath
});
}
Here object path is as follows-
/Entityname/<id of a partcular item in that entity>
When I am trying to show the start time property in the view, it returns object object.I need the time in string format.I have already used formatter for the same in a table and it works fine.But there the aggregation items binding was different because it was a table control.I need the value in input field in UI5 form Please help