Add Property “additionalText” to TabContainerItem of TabContainer

  • Patrick
        Has successfully completed the online course Introduction
      1 year ago #37165
      Up
      0
      Down
      ::

      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
          Has 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)
        1 year ago #37431
        Up
        0
        Down
        ::

        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

        Patrick
            Has successfully completed the online course Introduction
          1 year ago #37433
          Up
          0
          Down
          ::

          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.
          Patrick
              Has successfully completed the online course Introduction
            1 year ago #37507
            Up
            0
            Down
            ::

            Hi Armin,

            thanks for your detailed explanation! I’m not allowed to watch the video at the moment because I have to finish the previous lesson first. I’ll watch it later!

            I updated and re-uploaded the test project for you. Hopefully this gives you a better understanding of my problem with data binding in TabContainer and the content of its items.

            To reproduce case 1 (client side business object only), add 1-2 TabItems, delete one and then add one again. A duplicate ID error message follows.

            For case 2 (script only) the item is missing the actual content which I can’t add using the addContent method even though the aggregation is set in the widget settings. If I could do it, it wouldn’t have a binding anyway, right?

            Case 3 (script and client side business object) is my attempt to force the content via the binding without generating an ID error message.

            Thank you for your time!

            Armin Winkler
                Has 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)
              1 year ago #37575
              Up
              0
              Down
              ::

              Hi Patrick,

               

              just to let you know: In the meantime we have updated our standard content accordingly. From now on, our standard widget TabContainer should not throw errors anymore in case you add items to it after having removed an item previously.

               

              Thank you for your valuable feedback and kind regards,

              Armin

            Viewing 5 posts - 16 through 20 (of 20 total)

            You must be logged in to reply to this topic.