Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Update oData binding from input table

$
0
0

Hello,

 

I used the template of Master/Master application with SAP WEB IDE. My model is filled by a Odata (TwoWay binding from what I understand)

        var oConfig = {            metadataUrlParams : {},            json : true,            // loadMetadataAsync : true,            defaultBindingMode :"TwoWay",            defaultCountMode: "Inline",            useBatch : true        };        var oModel = new sap.ui.model.odata.v2.ODataModel(sServiceUrl, oConfig);

The application works well for display data in table, filtering, grouping, ...

 

In the second screen, it's a table with items and quantities. I want to be able to update the quantity from the application. I create a CREATE_DEEP_ENTITY Method in my oDATA which works fine. The issue is that the odata of the model is not updated while I change the quantity in the view.

 

The xml view :

<ColumnListItem id="navigationListItem">     <cells id="navigationListItem_cells">          <Text id="navigationListItem_cells_cell_1" text="{Material}"/>          <Text id="navigationListItem_cells_cell_2" text="{MaterialDescr}"/>               <Input change="onInputChange" editable="{displayMode>/Edit}" id="itemqty" placeholder="0" type="Number" value="{Quantity}"/>     </cells></ColumnListItem>

the onInputChange method :




onInputChange: function(oEvent) {
        var oInputField = oEvent.getSource();        var oModel = oEvent.getSource().getModel();        var oParent = oInputField.getEventingParent();                var oItems = this._oNavigationTable.getBinding("items");        oItems.refresh(true);        oModel.refresh(true);



},

I did all the refresh I found (although I thought the refresh was not needed) but the oModel is always the same.

 

Thanks for your help.


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>