on 10-31-2019 12:35 PM
Hi,
Does anyone know how to attach an eventhandler to an input field in a way that the eventhandler also works when reopening the objectpage in a Fiori Listreport?
First time I open an Objectpage I attach the onSubmit to an inputfield in within method onAfterRendering:
onBeforeRendering: function (oEvent) { var oView = this.getView(); var oNamens = sap.ui.getCore().byId(oView.getId() + "--com.sap.vocabularies.UI.v1.Identification::namens::Field-input"); if (oNamens || null) { oNamens.attachSuggestionItemSelected(this._onNamensChanged, this); oNamens.attachSubmit(this._onNamensChanged, this); } },
So when I change the value of this inputfield, method _onNamensChanged is called. This works like a charm.
When I close the Objectpage open again, _onRouteDetailMatched is called, so I coded same logic in this method:
_onRouteDetailMatched: function (oEvent) { var oView = this.getView(); var oNamens = sap.ui.getCore().byId(oView.getId() + "--com.sap.vocabularies.UI.v1.Identification::namens::Field-input"); if (oNamens || null) { oNamens.attachSuggestionItemSelected(this._onNamensChanged, this); oNamens.attachSubmit(this._onNamensChanged, this); } },
But this time _onNamensChanged is not called when I change the value in the input field.
I have no idea why. Anyone?
Cheers,
Robert Dokter
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.