SmartClient Version: v11.0p_2016-07-14/LGPL Development Only (built 2016-07-14)
Chome latest (compiled mode), Firefox 26 (devel mode)
I'm trying to apply addMouseOverHandler on a Tile in a TileGrid as follow:
and recover the event's target canvas (hopefully a Tile) as has been said here in the forums using EventHandler.getTarget(). If the target is the TileGrid it works. The problem getTarget() throws AssertionError when SmartGWT instance the SimpleTile
SimpleTile.class
In the marked line refInstance is a Canvas instance and the assert fails even when refInstance JSON is:
Is this the normal behaviour? If yes, how do you add an over handler to a tile?
Best regards
Chome latest (compiled mode), Firefox 26 (devel mode)
I'm trying to apply addMouseOverHandler on a Tile in a TileGrid as follow:
Code:
addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { Canvas tile = EventHandler.getTarget(); if (tile instanceof SimpleTile) { SC.say(getTileIndex(tile)); } } });
SimpleTile.class
Code:
public static SimpleTile getOrCreateRef(JavaScriptObject jsObj) { if (jsObj == null) return null; final BaseWidget refInstance = BaseWidget.getRef(jsObj); if (refInstance == null) { return new SimpleTile(jsObj); } else { [B]assert refInstance instanceof SimpleTile; <= Exception is thrown!![/B] return (SimpleTile)refInstance; } }
Code:
SimpleTile { creator : [TileGrid ID : isc_FotoTileGrid_9], canHover : true, tileGrid : [TileGrid ID : isc_FotoTileGrid_9], ID : "isc_FotoTileGrid_9_tile_2", position : "absolute", className : "simpleTileOver", width : 150, height : 168, left : 349, top : 5, styleName : "simpleTileOver", tileNum : 2, record : Obj { ID : 149808 }, parentElement : [TileGrid ID : isc_FotoTileGrid_9], topElement : [Window ID : isc_FotoPeritacionWindowDynamicForm_0], tabIndex : 2628, ruleScope : "isc_FotoPeritacionWindowDynamicForm_0", cacheOffsetCoords : true, showDown : false, zIndex : 209630, state : "Over", }
Best regards
Comment