Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Tab does not update its icon anymore

    We have lots of tabs, with dynamic icons that show various amount. We periodically update this icons. This is unchanged code since several years, but after the update to 6.0 we happened to notice that they do not update anymore.

    We can see that the new icon is fetched from the server as expected, but the tab icon is not changed on-screen like it used to.

    Code:
    Tab tab = new Tab(title, icon);
    tab.setIconWidth(iconWidth);
    tab.setIconHeight(iconHeight);
    tab.setPane(pane);
    //above works, shows correct icon
    .....
    
    //changing the icon below used to work, now it has no effect in browser
    String url = imageCreator.getUrl(length);
    System.out.println("url for "+tab.getName()+ " : "+url);
    tab.setIcon(url);
    6.0-p20161207

    #2
    This would not be expected to work. After setTabs(), all modifications to tabs need to be through API on the TabSet, not the Tab objects. So you want setTabIcon() in this case.

    Comment


      #3
      Well, as i said, it has worked in previous versions, and it's not mentioned in the javadoc or anywhere else that i can find. I'm probably looking in the wrong place.

      Anyhow, I changed the code as per below, and it works as you said. Thanks.

      Code:
      //tab.setIcon(url);
      tab.getTabSet().setTabIcon(tab, url);

      Comment


        #4
        Hi all,

        this made me wonder and I had a similar issue with a ListGrid once where Isomorphic told me not to change ListGridField objects after setFields().
        I also think that they said this does not apply to FormItems.
        @Isomorphic: As a rule of thumb, is it correct to say that "members" that were set with setFields / setItems / setTabs / ... should only be accessed via their "manager widget" and that this applies to all widgets but DynamicForm/FormItems?

        Best regards
        Blama

        Comment


          #5
          That's accurate for fields, tabs, CubeGrid facets but not Layout.members or Canvas.children, and places like Dialog.buttons support both approaches.

          Comment

          Working...
          X