Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mouse over event on the column of a GWT celltable

Tags:

gwt

I want to create a mouse over event on the column of a GWT celltable. Can you help me?

like image 269
Rajaa Avatar asked Oct 19 '11 08:10

Rajaa


1 Answers

If you mean CellTable, you can try something like that...

table.addCellPreviewHandler(new Handler<IdObject>()
    {

        @Override
        public void onCellPreview(
            CellPreviewEvent<IdObject> event)
        {
            if ("mouseover".equals(event.getNativeEvent().getType())) {
                Element cellElement = event.getNativeEvent().getEventTarget().cast();
                // play with element
            }
        }
    });

UDP: Method for getting cell value.

private String getElementValue(
    Element element)
{
    Element child = element.getFirstChildElement().cast();
    while (child != null)
    {
        element = child;
        child = element.getFirstChildElement().cast();
    }
    return element.getFirstChild().getNodeValue();
}
like image 87
cardamo Avatar answered Nov 09 '22 14:11

cardamo