Announcement

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

    IMenuButton does not disable title

    As mentioned in my other thread, we just upgraded from 2.5p to 4.0. We're running into this...

    When I call IMenuButton.setDisabled(true), the button title does not turn gray (it stays black). The down arrow icon turns gray though. The SmartGWT console shows the title as having the buttonTitle style. I checked the CSS file and I do see buttonTitleDisabled but it's not getting applied to the button. I tried calling redraw() but that didn't work.

    isc.version = v9.0p_2013-09-11/PowerEdition Deployment
    Firefox 7.0

    #2
    I tried using MenuButton instead of IMenuButton and it works properly. The javadocs say MenuButton uses CSS while IMenuButton uses an image. Does anyone know the advantages and/or disadvantages of using each are?

    Comment


      #3
      We are not aware of a problem with the title of an IMenuButton failing to show disabled appearance when the button is disabled. This works for us in our tests.
      Can you show us a way to reproduce the problem?
      Also please let us know which skin you're seeing this problem in and what doctype specification you have in your bootstrap HTML file.

      To answer your broader question about what IButtons are:

      SmartClient supports Buttons rendered out as a simple DIV with CSS applied to it, and image-based buttons (ImgButton, StretchImgButton).

      Historically certain visual appearances such as gradients, rounded corners have been impossible to achieve using simple CSS applied to a div. With wider support for HTML5, these limitations have been reduced a great deal but in older browsers and skins, a Button would typically render as something of a simple, flat rectangle, and you'd have to use ImgButton or StretchImgButton to get a more attractive appearance.

      IButton (and IMenuButton) is essentially a shortcut for "an attractive appearance button" - these will be subclassed from StretchImgButton in certain skins, or from Button in other skins. The idea is that the developer can create IButtons without having to worry about the implementation, and the theme will have logic to use the most appropriate rendering mechanism to give an attractive appearance.

      Comment


        #4
        I did a test with just a IMenuButton and another button to call setDisabled(). The button was disabled but the title still had the enabled style.

        I'm using the default theme and I don't see a DOCTYPE in my HTML file. Should I put a DOCTYPE in?

        Comment


          #5
          Yes, add <!DOCTYPE html> as indicated in the FAQ.

          Comment


            #6
            I added the DOCTYPE but it didn't help.

            Comment


              #7
              Aha! We're reproducing this problem. We should have a fix for you in the near future (we'll follow up on this thread when we do), but for now, you can just call "markForRedraw()" on the button after the call to "setDisabled()" to ensure the disabled styling shows up.

              Regards
              Isomorphic Software

              Comment


                #8
                We've now made a change to address this issue. Please try the next nightly build dated Oct 5 or above (4.1d, 4.0p and 3.1p branches)

                Regards
                Isomorphic Software

                Comment


                  #9
                  Menu of IMenuButton does not appear in older Firefox

                  We got the 10-05-13 nightly and it works in Firefox 7.0. However, some of our clients use Firefox 3.0.6 and when they click on the IMenuButton, the menu does not appear. This is in the console:
                  Code:
                  TypeError:__5 is undefined
                  Stack from error.stack:
                    Button.stateChanged() @ sc/modules/ISC_Foundation.js:455
                    StatefulCanvas.setState(_1=>"") @ sc/modules/ISC_Foundation.js:173
                    StatefulCanvas.handleMouseOut(_1=>{Obj}, _2=>undef) @ sc/modules/ISC_Foundation.js:215
                    [c]EventHandler.bubbleEvent(_1=>{Obj}, _2=>"mouseOut", _3=>undef) @ sc/modules/ISC_Core.js:1258
                    [c]EventHandler.handleEvent(_1=>{Obj}, _2=>"mouseOut") @ sc/modules/ISC_Core.js:1045
                    EventHandler..handleMouseMove(null, {Obj}) @ sc/modules/ISC_Core.js:1108
                    EventHandler._handleMouseMove(null, {Obj}) @ sc/modules/ISC_Core.js:1098
                    EventHandler._delayedMouseMove(1381450716573) @ sc/modules/ISC_Core.js:1098
                    [c]Class.fireCallback(_1=>{Obj}, _2=>undef, _3=>[object Array], _4=>{Obj}, _5=>true) @ sc/modules/ISC_Core.js:270
                    Timer._fireTimeout("$ir389") @ sc/modules/ISC_Core.js:1016
                    unnamed() @ sc/modules/ISC_Core.js:1012
                    unnamed() @

                  Comment

                  Working...
                  X