
In order to achieve the above requirement I have followed below steps.
<la:form.SimpleForm id="form21" minWidth="1024" title="Classification Info" maxContainerCols="2" editable="true"
layout="ResponsiveGridLayout" labelSpanL="3" labelSpanM="3" emptySpanL="4" emptySpanM="4" columnsL="1" columnsM="1" class="editableForm">
<la:content>
<Label id="opportunityGroup_Label" text="Opportunity Group"></Label>
<Select id="opportunityGroup" items="{json>/OpptGroupSet}" >
<items>
<core:Item key="{json>OpptGroupCode}" text="{json>Description}"></core:Item>
</items>
</Select>
<Label id="originLabel" text="Origin"></Label>
<Select id="origin" items="{json>/OriginSet}" >
<items>
<core:Item key="{json>OriginCode}" text="{json>Description}"></core:Item>
</items>
</Select>
</la:content>
</la:form.SimpleForm>
extHookGetAdditionalCustomizing: function() {
// Place your hook implementation code here
var that = this;
var oModel = that.getView().getModel();
var sStatusPath1 = "OpptGroupSet";
if (this.processType && this.processType !== "") {
var sFilterValue1 = jQuery.sap.encodeURL("OpptType eq '" + this.processType + "'");
sStatusPath1 = sStatusPath1 + "?$filter=" + sFilterValue1;
}
var a = [];
a.push(that.getView().getModel().createBatchOperation("OriginSet", "GET"));
a.push(that.getView().getModel().createBatchOperation(sStatusPath1, "GET"));
oModel.addBatchReadOperations(a);
return oModel;
},
extHookHandleBatchResponses: function(r) {
// Place your hook implementation code here
var s = {
OpptGroupSet: [],
OriginSet: [],
};
var o = new sap.ui.model.json.JSONModel();
var oppgrp = new sap.ui.model.json.JSONModel();
//Opportunity group binding
if (r.__batchResponses[5].statusCode === "200") {
s.OpptGroupSet = r.__batchResponses[5].data.results;
} else
this.handleErrors(r, true);
var opptGrp = {
OpptGroupSet: [{
Description: "",
LanguageCode: "",
OpptType: this.processType,
OpptGroupCode: ""
}]
};
if (s.OpptGroupSet.length !== undefined) {
for (var j = 0; j < s.OpptGroupSet.length; j++) {
if (s.OpptGroupSet[j].OpptType === this.processType) {
opptGrp.OpptGroupSet.push(s.OpptGroupSet[j]);
}
}
oppgrp.setData(opptGrp);
this.byId("opportunityGroup").setModel(oppgrp, "json");
this.byId("opportunityGroup").setSelectedKey(0);
}
//origin set binding
if (r.__batchResponses[4].statusCode === "200") {
s.OriginSet = r.__batchResponses[4].data.results;
} else
this.handleErrors(r, true);
var origin = {
OriginSet: [{
Description: "",
OriginCode: ""
}]
};
if (s.OriginSet.length !== undefined) {
for (var i = 0; i < s.OriginSet.length; i++) {
origin.OriginSet.push(s.OriginSet[i]);
}
o.setData(origin);
this.byId("origin").setModel(o, "json");
this.byId("origin").setSelectedKey(0);
}
},
extHookSaveOentry: function(E) {
// Place your hook implementation code here
var that = this;
// Place your hook implementation code here
E.OpptGroupText = that.getView().byId("opportunityGroup")._getSelectedItemText();
E.OpptGroupCode = that.getView().byId("opportunityGroup").getSelectedKey();
E.OriginText = that.getView().byId("origin")._getSelectedItemText();
E.Origin = that.getView().byId("origin").getSelectedKey();
return E;
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
23 | |
20 | |
9 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |