on 03-04-2013 8:33 AM
Hi,
I'm currently looking for information regarding the features available in sapui5 binding paths. When looking at https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/BindingElements.html (the master details example) it looks like there is support for index based access in json arrays but haven't found any official statement in the documentation. Also a thing that would be very useful IMHO is some kind of pattern matching support (like ant path patterns or like globbing in unix shells) in binding paths to access for instance nested content for a unknown key. Are there any plans for supporting such functionality? Regarding the current syntax for model access (model name followed by '>') there has to be some support already available. Would also be cool if the documentation gets improved to explain the supported features better.
Best regards,
Tobias
Hi Tobias,
regarding the index based access. This works fine only for JSON models. In the case you have an array containing objects you would be able to access those entries via the index in the binding path: /0/myKey.
Our databinding already supports relative paths. E.g. if you bind the values of a TextField against the properties of and object inside an array you would do this relative:
oModel.setData({modelData: [ {"prop1": ""}, {"prop1": ""}, {"prop1": ""}, {"prop1": ""}]});
var oField = new sap.ui.commons.TextField({value: "{prop1}"});
To now make a valid binding you can set the binding context of that TextField to the first entry. This is what you typically would do for master details scenarios. In case of the Table or a Dropdown you could get the binding context of the selected row or item and apply it on the field:
oField.setBindingContext(oItem.getBindingContext());
or you could do so manually via bindElement - it allows you to specify a binding context path:
oTextField.bindElement("/modelData/1");
The last point you mentioned is the multimodel support. I will take this point. Maybe some hints here:
oControl.setModel(oModel, "myModel"); // sets a named model
oControl.bindText("myModel>/prop1"); // bind the property prop1 to the text prop of the control
In 1.8 we do not support aggregation binding for named models t.m.k. This will come with 1.10. I will check again.
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi I have similar situation
if i have a single model but with nested entries , how should i bind my columns to the respective paths
I want a table with columns id and age ,the model is nested
id -> data/one/id
age -> data/two/age
var demoJSONModel = new sap.ui.model.json.JSONModel({
data :{one:[
{ id : 42,pos:'-' },
{ id : 1.618,pos:'-' },
{ id : 3.14,pos:'-' }
],two:[
{age:43},
{age:41},
{age:40}
]}
});
oView.setModel(demoJSONModel);
oView.placeAt("content");
<core:View
xmlns:core="sap.ui.core"
xmlns="sap.ui.commons"
xmlns:table="sap.ui.table"
xmlns:html="http://www.w3.org/1999/xhtml"
controllerName="view.Main">
<Panel text="Hello World from an XML view">
<Button text="Button" press="doSomething"></Button>
<table:Table width="100%" visibleRowCount="5" selectionMode="Single" editable="false" rows="{/data}">
<table:title><Label text="Wochentage"></Label></table:title>
<table:Column>
<Label text="ID" />
<table:template><TextField value="{/one/id}"></TextField></table:template>
</table:Column>
<table:Column>
<Label text="ID" />
<table:template><TextField value="{/two/age}"></TextField></table:template>
</table:Column>
</table:Table>
</Panel>
</core:View>
Hello, i'm a experienced Sap dev but a noob noob SAPUI5 dev, so i'm facing a lot of problem regarding SAPUI5, even with a lot of examples. Here is my Problem :
I retrieved values from the getSelectedContextPaths()....
i want to get the value of an element in one of the array line :
"SelectedPath ": Array[2]
But i don"t know how to do this . Please Help !
Regards
Laurent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
aggregation binding for named models is supported since 1.10.
Regards
Johannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
thanks for the information. The delay won't be a show stopper for us. Short question slightly off topic: I don't know what the SAP policy is here but would it be possible to share a rough development roadmap for sapui5 with the community? I think there is definitely an interest in the features which are currently in the pipeline and when to expect a release of those. Also it would be cool to get access to the current development version of sapui5 to play around with new features and provide feedback or open bug reports (I think a ticket system/bug tracker is currently in preparation?).
Best regards,
Tobias
is there an news on the relaese?
is still pointing to 1.8.4.
Thanks a lot for an update.
Regards,
Stefan
Hi Stefan,
sapui5 version 1.10.2 has been released and deployed to the hana cloud last week. If you want to use the sapui5 jars for this release in a web application you'll have to wait until april 11th because the hana tools update site still contains version 1.8.9 (see http://scn.sap.com/thread/3334569).
Best regards,
Tobias
Hi Tobias,
thanks for the information!
Is it possible to use the update site
https://tools.hana.ondemand.com/juno (as it is stated for SAP HANA Cloud) for SAPUI5 development as well? Or is there another remote update site for SAPUI5?
Thanks!
Hi Stefan,
can you explain what you understand by 'SAPUI5 development'? In fact the eclipse update site you mentioned is the one I named hana tools update site. If you point eclipse to this location you'll be able to install tooling for creating web applications with sapui5 interfaces. Note that you can also write applications which don't include the sapui5 runtime but use the runtime deployed at the hana cloud (https://sapui5.netweaver.ondemand.com/sdk/) and define some local resources (see https://sapui5.hana.ondemand.com/sdk/#docs/guide/ModularizationConcept.html).
Best regards,
Tobias
Hi Tobias,
thanks for the links!
normally, the starting point for SAPUI5 development is here:
Within this zip file there is also an folder called "tools-updatesite" which contains the actual eclipse plugin and therefore the actual SAPUI5 libraries. At the moment this is 1.8.4.
I wondered if this approach (downloading, unpacking that "tools-updatesite" folder, etc.) could be simply replace with a normal update site url, which hosts the actual version of the SAPUI5 eclipse Plugin.
So thinking about that, my question was whether the url https://tools.hana.ondemand.com/juno could be used to always have the actual SAPUI5 eclipse plugin available. I'm only interested in the actual eclipe plugin for SAPUI5, Hana Tools is not crucial.
When I got you right, your tip was to include the core library directly, e.g. https://sapui5.netweaver.ondemand.com/sdk/resources/sap-ui-core.js. That would be a solution for runtime, but then I would not get the code completion and help texts in eclipse. For me as a beginner, they are quite essential. 🙂
So, therefore I asked if there is a difference (except of course the version at present) between the eclipse plugin for SAPUI5 contained in the Hana tools compared with the plugin in the "tools-updatesite" folder.
Regards,
Stefan
Hi Stefan,
I don't really know whether there is a difference in the tooling since I started right away with the sapui5 tooling from the cloud update site. When using this update site you can choose to only install the sapui5 feature. This includes the runtime jars and the tooling so you'll get everything you need.
Best regards,
Tobias
Hi Stefan,
this is only an evaluation package at the moment. We do not update it regulary at the moment. Our main shipment is happening through the cloud either as deployed app or as Eclipse tooling. We discussed this already to provide a newer version here.
I will try to find an answer soon.
Best regards,
Peter
Hi Andreas,
we have different distribution channels which differ in their installation behavior and compatibility. In general it is not recommended to mix installations from different distribution channels. I.e. you should first uninstall the version from the SCN beta shipment and then install it from the cloud updatesite. Otherweise you could get strange errors during update.
The available channels are:
- Service Market Place: Zip-Download of the updatesites containing the latest released version. Required Eclipse features have to be installed manually in advance.
- Cloud update site: Latest released version. Installs everything needed automatically. Best user experience. The ABAP repository connector is not yet included but this is planned for SAPPHIRE.
- SCN Shipment: Contains a zipped update site. Is not up to date
- SAP Internal update site: Contains the latest development versions
Best regards
Matthias
User | Count |
---|---|
69 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.