Announcement

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

    Updating Tab prompt doesn't update the Hover text

    Hi Isomorphic,

    Can you please provide me some guidance on how we can have the Tab Hover respect a Tab prompt change?

    For example, we create a Tab (someTab), and add it to the TabSet, and then dynamically we call someTab.setPrompt("New Prompt"), yet, the Hover (when you hover the mouse over the tab title, for example) still displays the original prompt.

    SmartClient Version: v10.1p_2017-08-10/Pro Deployment (built 2017-08-10)

    Thanks

    #2
    Those tabs are configurations provided in order for the TabSet to create actual widgets to represent tabs. Once setTabs() has been called, modifications will not have an effect. Instead, use getTab() to retrieve the live tab widget.

    Comment


      #3
      We are using tabSet.getTabs() actually, the someTab variable was simply to indicate we were calling setPrompt on the tab itself.

      Code:
              Tab[] tabList = tabSet.getTabs();
              for (Tab tab : tabList) {
                  ...
                  tab.setPrompt(newPrompt);
              }
      Is this not sufficient?

      Thanks

      Comment


        #4
        To get the actual Tab widget you want getTabCanvas(). Sorry for the confusion.

        Comment


          #5
          That did the trick, thank you very much.

          If I want the same hover to appear when hovering over a menu item in the TabPicker, for example, is there a simple way to enable hovering on the TabPicker menu item?

          Thanks

          Comment


            #6
            Hi Isomorphic,

            I did some experimenting with a TabPicker auto child, but didn't have any luck.

            Regards

            Comment


              #7
              You've have to go with a pretty weird hack to get all the way into the auto-generated Menu shown by the tabPicker, as it's not an AutoChild. A different option would be to set tab.pickerTitle, which allows an alternate title to be shown in the picker menu. You could take whatever you are trying to show on hover and place it there.

              Comment


                #8
                Thank you, we used the tab picker title option, however, after the picker titled is displayed in the Menu, any future changes to the picker title do not get picked up in the Menu.

                Is there a way to have the Menu refresh the displayed picker title if it changes?

                Thanks

                Comment


                  #9
                  An update...
                  I have noticed that in the basic case where no tab picker title is used, and the menu displays the tab title, when you edit the tab title, the new tab title is appropriately reflected in the menu.
                  Knowing this, I think I have a workaround by simulating a tab title edit.
                  Will follow up.
                  Regards

                  Comment


                    #10
                    I have confirmed my workaround works, using tabSet.editTabTitle(tab.getID()) / tabSet.saveTabTitle() to simulate the tab title edit, which in turn refreshes the menu.

                    Comment

                    Working...
                    X