Announcement

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

    Tab.setCanEditTitle(Boolean) toggle

    SmartClient Version: v9.1p_2014-07-06/Pro Deployment (built 2014-07-06)

    I am looking for a way to toggle the canEditTitle attribute after the tab is already drawn.

    Under certain circumstances, I want to disable/enable the ability to edit the tab title dynamically after the tab is already drawn, however, when I call Tab.setCanEditTitle(Boolean), it doesn't seem to make a difference.

    Can you suggest a way to handle this?

    Thanks

    #2
    To do this after the tabset has been drawn, call both getTab() and getTabCanvas() and update canEditTitle. In the latter case, do it via setAttribute("canEditTitle", false).

    Comment


      #3
      getTabCanvas() returns StatefulCanvas and I am not seeing a "setAttribute" API on that object.
      Thanks

      Comment


        #4
        It's inherited all the way from BaseWidget.

        Comment


          #5
          The setAttribute APIs on BaseWidget are "protected" and they all take the allowPostCreate parameter.

          However, it looks like setProperty works.

          Code:
          tab.setCanEditTitle(canEditTitle);
          StatefulCanvas c = tab.getTabCanvas();
          c.setProperty("canEditTitle", canEditTitle);

          Comment


            #6
            Sorry for the thinko, yes, setProperty() is what we meant.

            Comment

            Working...
            X