Has anyone managed to get the hoverComponent to work with a TileGrid? I've made use of the following:
When the method is overridden for a normal Canvas object (such as a DynamicForm, for example), the Hover item appears correctly (and bravo - it looks fantastic).
Overriding the Parent tileGrid does nothing, BUT - this suggests the way forward:
The code I've tried to use is as follows:
Unfortunately this doesn't trigger a DetailViewer hovercomponent. There's a dearth of use cases, and javadoc the isn't enlightening.
Thanks,
Terry
Code:
@Override public Canvas getHoverComponent() { Record record = tileGrid.getSelectedRecord(); DetailViewer hoverViewer = new DetailViewer(); hoverViewer.setWidth(200); hoverViewer.setDataSource(ds); Criteria criteria = new Criteria(); criteria.addCriteria("itemID", record.getAttribute("itemID")); hoverViewer.fetchData(criteria); return hoverViewer; } testCanvas.setShowHover(true); testCanvas.setCanHover(true); testCanvas.setShowHoverComponents(true);
Overriding the Parent tileGrid does nothing, BUT - this suggests the way forward:
Originally posted by Isomorphic
View Post
Code:
//TileGrid final static TileGrid tileGrid = new TileGrid(); //setTileProperties Canvas final static Canvas tileCanvas = new Canvas(){ //Override the getHoverComponent for the setTilesProperties Canvas //This is identical to the previous test case @Override public Canvas getHoverComponent() { Record record = tileGrid.getSelectedRecord(); DetailViewer hoverViewer = new DetailViewer(); hoverViewer.setWidth(200); hoverViewer.setDataSource(ds); Criteria criteria = new Criteria(); criteria.addCriteria("itemID", record.getAttribute("itemID")); hoverViewer.fetchData(criteria); return hoverViewer; } }; final static DataSource ds = SwitchXmlDS.getInstance(); private static void setupTileGrid() { tileCanvas.setShowHover(true); tileCanvas.setCanHover(true); tileCanvas.setShowHoverComponents(true); //set the TileProperty to use tileCanvas settings tileGrid.setTileProperties(tileCanvas); }
Thanks,
Terry
Comment