Announcement

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

    Disabled button only giving default browser context menu.

    Hi all

    Using Firefox 3.6.6, GWT 2.0.3 on Win XP SP3.

    I cannot get a GWT context menu to appear on a disabled button. Instead I get the standard browser context menu.

    import com.smartgwt.client.widgets.IButton;
    IButton diagnoseBtn;
    diagnoseBtn = new IButton(lang.diagnoseText()); diagnoseBtn.setContextMenu(ContextMenu.CreateHelpMenu(ContextMenu.HELP_ID.DIAGNOSE_BTN));
    diagnoseBtn.setDisabled(true);

    The context menu works fine when the button is not disabled.

    Hope someone can help
    Thanks

    #2
    "Disabled" means non-interactive, so this is by design. End users are unlikely to click on a button with disabled appearance. Is there another place you can put the context menu?

    Comment


      #3
      Hi,
      Thanks for the response.
      I can accustom my self to there being no response from a disabled button. What I find issue with is that I can't stop the default browser context menu being raised from a disabled button. No where else in the app is it possible to raise this menu so it seems a bit random not to mention the fact I don't want the users accessing browser functionality while running the app.
      Thanks for the insight though, much appreciated.
      Tom

      Comment


        #4
        Use GWT's global event handling mechanism to trap it (EventPreview).

        Comment


          #5
          Thomas, were you be able to success on that ?

          Am running into a similar situation... for me not only the disabled button, but also the grid filters after cancelling the the context menu on the root layout.

          I believe handling using EventPreview will cancel the whole right click itself instead of just blocking the default context menu.

          Comment


            #6
            I have the same scenario with Imag , it will show default context menu when its disabled .....


            Any update on that please ???

            Comment

            Working...
            X