1 Reply Latest reply on Jun 26, 2014 3:26 PM by csa

    How to make Elements of a ListWidget Clickable

    malpi

      Hi there,

       

      I am struggling around with the ListWidget.

      I'd like to add a ClickListener to each Element the ListWidget is showing. Is this possible at all? Following the documentation it's possible to create a new DIV inside of a widget and add a Listener to it.

      But as soon as I start working with "DivElement" the compiler complaints that this Element is not specified enough?

       

      Best Regards,

       

      Malte

        • 1. Re: How to make Elements of a ListWidget Clickable
          csa

          Hi Malte,

           

          The way this should work is by adding an @EventHandler to your item widget type (the type you use to display a list item):

           

          public class MyListItemWidget extends Composite implements HasModel<MyModel> {
            ....
          
          
            @EventHandler
            private void onClick(ClickEvent e) {
              ...
          
            }
          }
          


          Cheers,

          Christian