0

I want to give the filter button a right click function that when I right click it, it will clear all the grid criteria.

        setFilterOnKeypress(false);
        setFilterByCell(true);
        setFilterButtonPrompt("Left click to filter, right click to clear all texts.");
        Button button = new Button();
        button.addClickHandler(new ClickHandler()
        {

            @Override
            public void onClick(ClickEvent event)
            {
                if (event.isRightButtonDown())
                {
                    SC.warn("right clicked");
                    clearCriteria();
                }
            }
        });
        setFilterButtonProperties(button);

This is not working, any ideas on why it isnt working?

PhoonOne
  • 2,678
  • 12
  • 48
  • 76
  • You might want to have a look at this: http://stackoverflow.com/questions/1434318/right-click-in-gwt/ – Martijn Wijns May 28 '14 at 14:43
  • Have you tried using a custom button that implements `ContextMenuHandler` and sinks `addDomHandler(this, ContextMenuEvent.getType());`? – z00bs May 30 '14 at 13:43

1 Answers1

0

Keep the functionality separate. There is no meaning of mixing two different tasks on the same button. Think from the end user's perspective.

Read more on your another post Pass a handler to filter button property that is some what asked in the same context.

Community
  • 1
  • 1
Braj
  • 46,415
  • 5
  • 60
  • 76