Tab Container Widget Error

  • Ishant
        Has successfully completed the online course Basics (100)
      3 years ago #28484

      Hi,

       

      I am using tab container widget. I have bind my array to the tab container and whenever I try to remove and then add new element to my array. It throws error and new element / (tab container item) is not added to the tab container widget. Error is related to the ID duplicacy. Even though element is removed from tab container, but it still shows ID duplicacy error whenever new element is inserted.

       

      I have also attached screenshot of the error for your reference

       

      Thanks,

      Ishant Kushwaha

       

      Attachments:
      You must be logged in to view attached files.
      Jennifer Häfner
          Has successfully completed the online course Intermediate (200)
          Has successfully completed the online course Advanced (300)
          Has successfully completed the online course Basics (100)
          Has successfully completed the online course Advanced (310)
          Has successfully completed the online course Advanced (320)
          Has successfully completed the Intermediate Certification
          Has successfully completed the Advanced Certification
        2 years ago #29019
        Up
        0
        Down
        ::

        Hello Ishant,

        This error seems to occur because you are binding the tab items via a global variable (an array of objects). When pressing the ‘x’ button of a tab item, the ‘itemClose’ function (which is defined in the widget ‘TabContainer’) is triggered and removes the tab item.

        But when you remove the corresponding object from the global variable manually (by subscribing to the ‘itemClose’ event of the TabContainer in the Process Designer), the ‘itemClose’ function is triggered once again and produces the error because it cannot find the item since it has been removed before.

        So what you could do: in the widget ‘TabContainer’, adapt the ‘itemClose’ function.

        Instead of this part:

        if (this.fireItemClose({item: oRemovedItem})) {
        this.removeItem(oRemovedItem); // the tabstrip item will also get removed
        }

        add this code:

        this.fireItemClose({
        item: oRemovedItem
        });

        With this change, the binding via a global variable should work fine.

      Viewing 2 posts - 1 through 2 (of 2 total)

      You must be logged in to reply to this topic.