I can’t figure out how I can add a click handler on a cell in a cellbrowser in GWT.
I found another question here on StackOverFlow related to my question, but it was for a double click handler. I can’t figure out how to add just a normal click handler.
My purpose is when a user clicks on a cell in the cellbrowser it downloads the child notes from a server. I already played around with onBrowserEvent but I could not get it work.
You can’t add a
ClickHandlerlike normal because aCellis not aWidget.AbstractCelldoes have some methods that make it convenient for you to handle events, but you have to call its constructor with the names of the events you’d like to listen to. For instance, you’d pass “click” to the constructor of your cell, overrideonBrowserEvent, and check for “click” events there.Look at the source for the
ClickableTextCellto see how Google added click listeners to a cell.