on 11-13-2015 11:05 AM
Dear developers,
I have general question regarding very common real scenario with SAPUI5 and SAP NW Gateway.
Let's have sales order object which should be created/maintained using SAPUI5 application.
I tried to solve this task and faced the problem with new item:
How to solve this issue, or do you have another experience?
Thanks Zdenek
Hello Gurus,
really no idea how to maintain ODataModel based table without immediate save to backend? How do you solve such situations? Would it be solution to read data from ODataModel, copy it to JSON model, work on it on the client and than copy it back to ODataModel for subsequent posting? It seems to me to be little bit complicated.
Thanks,
Zdenek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ryan,
it is pretty old thread but anyway... The problem I had can be resolved using draft concept of Fiori Programming Model. If you are not on the right NW version (I guess 7.51), you can try to implement the "draft" concept, for example by adding "dirty" flag to your database table. It could be true until final save is sent from the frontend.
Hope this helped,
Zdenek
do you use v2 odatamodel? server roundtrip shouldnot happen till you call submitUpdate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
thanks for your comment.
yes I use v2 model. I agree that there is no roundtrip till submitChanges() is issued. But no new lines appear in the table. Once submit is executed the CREATE is performed in the backend and table is populated with new data.
And this is basically problem. The user wants to see unsaved data and maybe decide to cancel (rollback) whole transaction. And it is impossible now because potentially unwanted data are already saved in the database.
Thanks,
Zdenek
Hi Maksim,
No, it is not right. I'd like to see data in the table without need to submit them to the backend. This is the code run within event handler
onTableItemAddButtonPressed : function(oEvent) {
var _oModel = this.getView().getModel("items");
var _oTable = this.getView().byId("idItems");
var _oEntry = {};
_oModel.createEntry(this.sWorkitemPath + "/ItemSet" ,
{
success : function() {
},
error : function() {
},
properties : {
});
// _oModel.submitChanges();
}
Till submitChanges is processed, no data appear in the table despite of being visible in OData property within model instance
After submitChanges data is created in the backend and after that visible in table.
Thanks Zdenek
<t:Table id="idItems" title="Items" editable="false" visible="true"
rows="{items>Item}" visibleRowCount="5" selectionBehavior="Row"
selectionMode="Single">
<t:toolbar>
<c:Toolbar>
<c:items>
<Button text="+" press=".onAddButtonPressed"
enabled="true" />
<Button text="-" press=".onDeleteButtonPressed"
enabled="true" />
</c:items>
</c:Toolbar>
</t:toolbar>
<t:columns>
<t:Column>
<Label text="Expense Type" />
<t:template>
<Input value="{items>Anln1}" editable="true" />
</t:template>
</t:Column>
</t:columns>
</t:Table>
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.