Add Property “additionalText” to TabContainerItem of TabContainer
-
2 years, 6 months ago #37020
Hi,
is it possible to add the property “additionalText” to the TabContainerItem? I tried editing the widget but it didn’t work. The sample is at:
https://sapui5.hana.ondemand.com/#/entity/sap.m.TabContainer/sample/sap.m.sample.TabContainerIcons
Attachments:
You must be logged in to view attached files.Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
2 years, 6 months ago #37024::Hi Patrick,
which version of OpenUI5 are you using to deploy your application? The property “additionalText” would only be available to use from version 1.63 upwards according to the documentation of SAP and is regarded as experimental: https://sapui5.hana.ondemand.com/#/api/sap.m.TabContainerItem
Kind regards,
Armin
Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
2 years, 6 months ago #37028::Hi Patrick,
Ok in that case the property should be supported by the OpenUI5 library. The way you edited your widget looks correct to me. Can you please share the configuration of the widget properties in the UI Designer? Do you see the new property there at all? Please also remember to deploy your application again after adding a value or binding to the “additionalText” property.
Kind regards,
Armin
2 years, 6 months ago #37032::Hi Armin,
the new property is available in the configuration of the widget properties! We implemented adding and deleting objects and everything works. Only the new property “additionalText” is not rendered in the TabItem. To demonstrate that a value exists, I set both bindings to the same target.
Attachments:
You must be logged in to view attached files.Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
2 years, 6 months ago #37035Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
2 years, 6 months ago #37059::Hi Patrick,
you can upload the transport file to this folder: https://files.simplifier.io/u/d/5e5f6978cf7043ee8c55/ password: uiGPK84o4HVt7yPn I’m going to remove the folder again as soon as I’ve retrieved the file.
Thank you,
Armin
Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
2 years, 6 months ago #37163::Hi Patrick,
I have good news for you: I was able to track down the missing link for the additionalText to show up properly. Please add the following line of code to the widget TabContainer’s custom script as well because only then will the bound value for the property be actually transferred to the internal TabStripItem that is being created by the TabContainer when you populate it with TabContainerItems:
Please let me know if this helps you.
Kind regards,
Armin
2 years, 6 months ago #37165::Hi Armin,
it works fine! That’s really great, thank you!
But I have another problem with using the TabContainer. If I’m just binding to a collection and then removed a TabContainerItem, I can’t add one anymore. I suspect it’s due to the lack of management of the TabContainer’s indices. I get the error message attached.
I’m using the client-side BO attached to manage the collection.
If I want to use the methods from the API reference instead, like addItem or insertItem, it doesn’t seem to harmonize with the binding anymore. Here is the link to the API:
https://sapui5.hana.ondemand.com/sdk/#/api/sap.m.TabContainer%23methods
How must it be implemented correctly?
Attachments:
You must be logged in to view attached files.Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
2 years, 6 months ago #37431::Hi Patrick,
which version of the TabContainer or the other involved dependent widgets like TabContainerItem etc. are you using? Have you tried importing our latest standard content based on OpenUI5 version 1.71 yet? If not (your initial screenshots suggest that is the case), you can download it from here: https://community.simplifier.io/downloads/standard-content/
Please keep in mind that you might have to apply your manual changes again that we talked about in previous comments. This should concern e.g. adding the property to TabContainerItem and referencing it in the widget script of the TabContainer. Please let us know if this helped to fix the duplicate id error as soon as you have updated the standard widgets on your system.
Kind regards,
Armin
2 years, 6 months ago #37433::Hi Armin,
thanks for your answer! I already imported the standard content on March 6th. The OpenUI5 version is 1.71 and that’s what my screenshots above show as well. I applied the manual changes in the widget script (e.g. I even successfully added the icon there and the TabContainerItem is already referenced in the TabContainer script).
I think the thing is that I still haven’t understood the interaction between the binding of the collection (as a data source) and the model of the TabContainer. That doesn’t seem the same, does it?
Case 1:
If I only use the binding (push a struct into a collection), then a TabItem is created, but I get the problem with the double ID as soon as I want to create a new TabItem (new struct) after removing one – so, as already described above.Case 2:
If I just use the widget methods (add and remove) instead, then there are no ID issues, but there is also no binding to my data source: The TabItems exist, but the collection remains empty.Case 3:
Do both have to be implemented (methods of the TabContainer and methods for the collection as data source)? If so, how is that intended? So when adding a new TabItem, do I have to execute the add function of the widget and also push the struct into the collection (in the same way when removing, first get the remove function of the widget and then the struct from the collection)? There is an example in the screenshot!A little tutorial or a Simplifier sample project would be very helpful! is this possible for you?
Attachments:
You must be logged in to view attached files.
You must be logged in to reply to this topic.