Hi ,
I'm working on an sapui5 application allowing user changing his own data (Adress,Family situation ..).
My odata looks like
empDataEntity->Expand "NavAdr" to get adress data
->Expand "NavFam" to get family data.
my odata is working fine.
In my xml viw, on the init, i'm did the following binding and it work
-- Controller ---
onInit: function () {
var that = this;
var oViewModel = new JSONModel({ busy: false, delay: 0 });
this.setModel(oViewModel, "View1");
tab1 = this.getView().byId("tab1");
selectedTab = tab1.getKey();
this._toggleButtonsAndView(false, selectedTab);
var oJsonModel = new sap.ui.model.json.JSONModel();
this._oODataModel = this.getOwnerComponent().getModel();
this.getView().bindElement({ path: "/employeeSet('')", // use OData parameters here if needed parameters: { "expand": "NavAdr" }, // react on binding events here events:
{ dataRequested: function (oEv) { that.getView().setBusy(true); },
dataReceived: function (oEv) {
oJsonModel.setData(oEv.getParameters().data); that.getView().setModel(oJsonModel, "myModel"); that.getView().setBusy(false); } } });
},
--- in the XML view
<f:content> <Label text="Validity Date"/> <DatePicker value="{ path:'myModel>/NavAdr/0/newBegda', type: 'sap.ui.model.type.Date', formatOptions: { pattern: 'dd/MM/yyyy',UTC:true }}" width="100%" id="begdaAdr" required="true" displayFormat="dd/MM/yyyy"/> <Label text="Rue / Num"/> <Input value="{myModel>/NavAdr/0/Stras}" required="true"/> <Input value="{myModel>/NavAdr/0/Hsnmr}"> <layoutData> <l:GridData span="XL1 L2 M2 S4"/> </layoutData> </Input> <Label text="Code Postal/Commune"/> <Input value="{myModel>/NavAdr/0/Pstlz}" required="true"> <layoutData> <l:GridData span="XL1 L2 M2 S4"/> </layoutData> </Input> <Input value="{myModel>/NavAdr/0/Ort01}" required="true"/> <Label text="Pays"/> <Select id="country" selectedKey="{myModel>/NavAdr/0/Land1}"> <items> <core:Item text="Belgium" key="BE"/> <core:Item text="England" key="England"/> <core:Item text="Germany" key="Germany"/> <core:Item text="USA" key="USA"/> </items> </Select> </f:content> </f:SimpleForm>
The view is correctly binded. But when i changed some adress data (for exp), and made
this.getView().getModel().submitChanges() nothing happens ??
The changes should call the adresseSet_entity_update .
In the model, there is nothing also in changeEntities ? How Can I solve this ?
Request clarification before answering.
Thx Sébastien. Attached a screen shot from codes (more readable indeed).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.