ListSelect: ClickListener

Hi all,

I wonder why ListSelect doesn’t have
addClickListener()
, which is useful for e.g. capturing double clicks.


addListener
I see , but the below doesn’t work:

        listSelct.setImmediate(true);
        listSelct.addListener(MouseEvents.ClickEvent.class, new MouseEvents.ClickListener() {
            public void click(MouseEvents.ClickEvent event) {
                System.out.println("clicked...");
            }
        }, MouseEvents.ClickListener.clickMethod);

Hi,

I’d guess the reason is that it’s not been deemed necessary :slight_smile: The code you posted does not work because there’s nothing to send the click events from the browser to the server.

You could create an enhancement request ticket about this to the vaadin trac. Also, I think it might be possible to add the click listener on client side with an extension. See
this book chapter
for more info.

-tepi

Thanks, created
Ticket 12206