While developing my application, I encountered a challenge with enabling users to dynamically add new labels and inputs into a form. The issue arises when the id for the new input is set as disabled by the user, but upon clicking the edit button, the enablement does not change to true. Consequently, the application fails to recognize the dynamically added input id in the form.
Below is a snippet of my code demonstrating this issue:
Add a new label and input to the existing form:
var _oSF2 = this.getView().byId("Extension_Form");
_oSF2.addContent(new sap.m.Label({
text: "Classification"
}));
_oSF2.addContent(new sap.m.Input({
id : "idExtensionInput1",
text : "text",
enabled: false
}));
Attempt to enable the new input:
handleEditPress: function () {
this.getView().byId("idExtensionInput1").setEnabled(true);
}