Search code examples
javawicketmouseoverdataview

How can I get in a "mouseover" event over a dataview table, in Wicket, the Row I'm over it with my mouse?


I have in Wicket, an dataview and I would need, in a event like this:

itemContainer.add(new AjaxEventBehavior("mouseover") {
    @Override
    public void onEvent(AjaxRequestTarget target) {
        IRequestParameters parameters = getRequest().getRequestParameters();
    }
});

To know which row in the column I put the mouse over. The debug is entering here when hoovering the mouse over the desired column but I only get in parameters parameters.getParameterValue("returnTabIndex") but this returns the column and I would need the row I'm over it. Does anyone knows how can I achieve this? Thanks!


Solution

  • if itemContainer is of type org.apache.wicket.markup.repeater.Item (or LoopItem) it should expose method getIndex which should return the row number it represents.