I'm having problems with getting the tile grid event handlers to work. I'm using custom tile constructor approach supplying a custom tile implementation which is derived from a dynamic form showing a couple of (editable) canvas items that show images, text items and so on.
However, this is the way that I initialize the tile grid
The TileGrid is rendered properly but while the double click handler behaves as expected, I will not get any record click or selection changed events when (single) clicking on the tiles.
Are there any known limitations on event handling when using custom tiles?
If so, what is the recommended approach for proper event handling in this case?
( Btw. If I replace the custom tiles with more primitive DetailViewerFields everything is working as expected).
Further, I tested with the custom tiles sample from the 4.1p showcase using the following adaptation
However, same result....
I hope, this information is somewhat sufficient for you. Any help is appreciated!
p.s. running GWT2.6, SmartGwt 4.1p with FF23.01
However, this is the way that I initialize the tile grid
Code:
private TileGrid folderGrid = null;
public LibraryItemPageProvider() {
folderGrid = new TileGrid();
folderGrid.setDataSource(ResourceDS.getInstance());
folderGrid.setWidth100();
folderGrid.setAutoHeight();
folderGrid.setOverflow(Overflow.VISIBLE);
folderGrid.setTileConstructor(FolderTile.class.getName());
folderGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
@Override
public void onSelectionChanged(SelectionChangedEvent event) {
SC.say(event.toDebugString() + ":" + event.getState());
}
});
folderGrid.addRecordClickHandler(new RecordClickHandler() {
@Override
public void onRecordClick(RecordClickEvent event) {
SC.say(event.toDebugString() + ":" + event.getViewer().getID());
}
});
folderGrid.addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
@Override
public void onRecordDoubleClick(RecordDoubleClickEvent event) {
SC.say(event.toDebugString() + ":" + event.getViewer().getID());
}
});
}Are there any known limitations on event handling when using custom tiles?
If so, what is the recommended approach for proper event handling in this case?
( Btw. If I replace the custom tiles with more primitive DetailViewerFields everything is working as expected).
Further, I tested with the custom tiles sample from the 4.1p showcase using the following adaptation
Code:
public Canvas getViewPanel() {
GWT.create(AnimalTileMetaFactory.class);
TileGrid tileGrid = new TileGrid();
tileGrid.setTileWidth(250);
tileGrid.setTileHeight(150);
tileGrid.setHeight100();
tileGrid.setWidth100();
tileGrid.setDataSource(AnimalXmlDS.getInstance());
tileGrid.setAutoFetchData(true);
tileGrid.setTileConstructor(AnimalTile.class.getName());
tileGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
@Override
public void onSelectionChanged(SelectionChangedEvent event) {
SC.say(event.toDebugString() + ":" + event.getState());
}
});
tileGrid.addRecordClickHandler(new RecordClickHandler() {
@Override
public void onRecordClick(RecordClickEvent event) {
SC.say(event.toDebugString() + ":" + event.getViewer().getID());
}
});
tileGrid.addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
@Override
public void onRecordDoubleClick(RecordDoubleClickEvent event) {
SC.say(event.toDebugString() + ":" + event.getViewer().getID());
}
});
return tileGrid;
}I hope, this information is somewhat sufficient for you. Any help is appreciated!
p.s. running GWT2.6, SmartGwt 4.1p with FF23.01