on 06-16-2023 12:26 PM
Dear All
I have listed below the UI5 code, posting data to Odata. However, on saving it, the system is giving error, which means OData Property LO is receiving Text value of ComboBox.
Property 'LO' at offset '186' has invalid value 'Not Clear'
<Label text="Legal Opinion" required="true" wrapping="true"/>
<ComboBox id="lo_id" showSecondaryValues="true"
value="{path: 'LO'}" editable="true" enabled="true"
width="50%" liveChange="_validateSaveEnablement" >
<items>
<core:ListItem key="1" text="Clear"/>
<core:ListItem key="2" text="Not Clear"/>
</items>
</ComboBox><br>
value="{path: 'LO'}"====>selectedKey="{path: 'LO'}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you Mean like below, it's also giving same error i.e. Text is passing to Odata instead of key while saving Form
<ComboBox id="lo_id" showSecondaryValues="true"
selectedKey="{path: 'LO'}" editable="true" enabled="true"
width="50%" liveChange="_validateSaveEnablement" >
<items>
<core:ListItem key="1" text="Clear"/>
<core:ListItem key="2" text="Not Clear"/>
</items>
</ComboBox
Yes "Clear" is passing to backend system where the property 'LO' is 1 character.
onSave: function() {
var that = this,
oView = this.getView(),
oModel = this.getModel(),
spath = oView.getBindingContext().getPath();
/********** Updating Odata MOdel ******************/
// abort if the model has not been changed
if (!oModel.hasPendingChanges()) {
MessageBox.information(
this._oResourceBundle.getText("noChangesMessage"), {
id: "noChangesInfoMessageBox",
styleClass: that.getOwnerComponent().getContentDensityClass()
}
);
return;
}
this.getModel("appView").setProperty("/busy", true);
if (this._oViewModel.getProperty("/mode") === "edit") {
// attach to the request completed event of the batch
oModel.attachEventOnce("batchRequestCompleted", function(oEvent) {
if (that._checkIfBatchRequestSucceeded(oEvent)) {
that._fnUpdateSuccess();
} else {
that._fnEntityCreationFailed();
MessageBox.error(that._oResourceBundle.getText("updateError"));
}
});
}
// this.handleUploadPress();
oModel.submitChanges();
}
},
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.