on 11-09-2015 5:34 PM
Hello,
What I want to do is firstly create a entry, then set the entry as my view's model
my code is like
oDataModel.create('/entries', entry, {
success : function(oData) {
var oVizFrame = self.getView().byId("idoVizFrame");
oVizFrame.setModel(new JSONModel("/enties('"+oData.Id+"')"));
}
});
The oDataModel contain the service root path so I pass only '/entries/'
however, in this line
oVizFrame.setModel(new JSONModel("/enties(guid'"+oData.Id+"')"));
how can I get my root path?
Besides, is there a better way to do it?
Thanks a lot
Hi Yan, the better way would be to set the model at the view level that way you can get the model for different controls based on the path - the root path will contain all the different types of data for your view. hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Finally what I do is :
oDataSet = oVizFrame.getDataset();
// bind url = ".../Points";
oDataset.bindData(bindUrl);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the point of doing
("/enties(guid'"+oData.Id+"')" ??
you expect json model to be like odatamodel? that will not work this way
what i would do:
oVizFrame.setModel(oDataModel);
oVizFrame.bindElement( "/enties(guid'"+oData.Id+"')" );
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply
This is exactly what I'm looking for. It still have some issues :
I want to do it like this:
I have my oDataModel which bind to /OData.svc/
var oDataModel;
// I use this model to create an entity:
oDataModel.create('/entities', entity,{
success: function(entry){
oVizFrame.bindElement("/entities(guid'" +entry.Id + "')");
}
})
the oVizFrame use the dataset :
var oDataset = new FlattenedDataset(
{
dimensions:
[
{ name: "Time", value: "{Time}", dataType : 'date' } ],
measures: [ { name : "Value", value : "{Value}" } ],
data: { path: "/Points" }
}
);
however, to get my timeseries data, sapui5 use the url
/Points
instead of
/Entities('id')/Points
Please help me if you know how to write it correctly
Thanks a lot.
Yan
The incomplete Discussion was deleted.
Regards, Mike (Moderator)
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.