Closed ghost closed 7 years ago
What about
<StandardTile
id="tile1"
icon="sap-icon://{launch>icon}"
title="{launch>title}"
press="handleTilePress"
/>
and
handleTilePress: function (oEvent) {
var oTile = oEvent.getSource();
/*switch (oTile.getId()) {
}*/
console.log(oTile.getId());
}
?
Regards Andreas
It will generate automatically id
property? When you look at https://openui5.hana.ondemand.com/1.40.3/docs/api/symbols/sap.m.StandardTile.html#constructor I can not find any id
property
Thanks
My TileContainer looks like:
<TileContainer
id="apps"
tiles="{launch>/Tiles}">
<StandardTile
id="{launch>id}"
icon="sap-icon://{launch>icon}"
title="{launch>title}"
press="handleTilePress"
/>
</TileContainer>
As you can see, the TileContainer
is bound on datasource that looks as follow:
{
"Tiles": [
{
"id": "calendar",
"icon": "calendar",
"title": "Assign user calendar"
},
{
"id": "characteristics",
"icon": "activity-individual",
"title": "Assign inspection characteristics"
},
{
"id": "terminal",
"icon": "laptop",
"title": "Assign terminal"
},
{
"id": "inspection",
"icon": "approvals",
"title": "Assign inspection value"
}
]
}
I've got following error:
Thanks
It is not possible to bind the "id" property, it can only be declared with a static (hardcoded) value, so it is no solution for your problem. But you might add custom data:
<StandardTile xmlns:z="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
z:myid="{launch>id}"
icon="sap-icon://{launch>icon}"
title="{launch>title}"
press="handleTilePress"
/>
At runtime, you can access custom data with
oEvent.getSource().data("myid")
Reg. documentation: properties are documented with the class that introduces them. Documentation for StandardTile therefore contains the hint
In addition, all settings applicable to the base type sap.m.Tile can be used as well.
sap.m.Tile then points to Control, Control to Element and Element to ManagedObject. That maybe not optimal when searching for properties, but adding all inherited stuff would make the documentation even more verbose and noisy than it is already. We are working on that and will improve it.
@codeworrior How do you know that? I was searching everywhere. Thanks so much.
Here you can see the documentation for custom data: https://openui5.hana.ondemand.com/#docs/guide/91f0c3ee6f4d1014b6dd926db0e91070.html
Hi @codeworrior : @kostonstyle 's issue is one of the symptoms of the fact thet #UI5 documentation lacks programmatic documentation and examples. I opened a general issue #1254 since it is a serious drawback for the whole platform.
Just my 2 EuroCents.
--R
I'm a friend of the programmatic documentation (parents should try to be a friend to their children, shouldn't they?). But don't you think that the Explored App can help developers to a similar extend?
I understand that the easy editing + run in a single page is missing. But on the other hand, the samples can be much more complex now and closer to a real world scenario (they can consist of multiple files likes views + controllers, components + manifest, Opa tests, mock data etc.). And there is a rich set of those examples.
Personally, I sometimes miss the explanatory texts - if they are not added as comments in the sample sources.
AFAIK, the colleagues responsible for documentation did interviews with different user groups and as a result decided to focus on the Explored App and to abandon (deprecate) the old, single page programmatic documentation. This decision was surely taken under the impression, that the Explored App can give the same or even better benefit to developers.
I assume that the colleagues are highly interested in feedback to the samples and to the Explored App in general. Maybe you (and others) want to add such feedback to #1254.
Kind Regards, Frank
A small quick note to say thanks @codeworrior . I addressed my note to you since I noted that you care about UI5. Expect a more detailed message in the days to come.
--R
Hi all
Please allow to set on
StandardTile
an Identification, because it is easier to handle, which Tile was clicked, for example:Now I can handle only over icon request:
But over an identification is more elegant.
Thanks