nijogeorgep / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Context Menu On Disabled ImgButton Defect #652

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi All , 

I would like to disable the default context menu that appear on right click on 
ImgButton So i use the following simple code 

    imgButton.addShowContextMenuHandler(new ShowContextMenuHandler() 
    {@Override
    public void onShowContextMenu(ShowContextMenuEvent event) {
            event.cancel();
        }
    });
This work fine for me bu when the ImgButton become disabled the default context 
menu return to appear ??!! 

How can i Solve this ??? 
Note : i open new thread on form 
(http://forums.smartclient.com/showthread.php?t=20232)
also there is another thread talks about the subject 
(http://forums.smartclient.com/showthread.php?t=12717)

Original issue reported on code.google.com by Arkan.D...@exalt.ps on 17 Jan 2012 at 9:29

GoogleCodeExporter commented 8 years ago
Disabled widgets will not fire this event at all, so you are not calling 
event.cancel().

If you want disabled appearance but still want to receive events so that you 
can cancel the native context menu, don't call disable() and use styling APIs 
to achieve the disabled appearance.

Original comment by smartgwt...@gmail.com on 17 Jan 2012 at 11:16