SmartClient Version: v10.0p_2015-10-16/Pro Deployment (built 2015-10-16)
I have a TileGrid similar to the one in http://www.smartclient.com/smartgwte...se/#upload_sql which shows user uploaded pictures from a database, but I want to use a custom TileConstructor like in http://www.smartclient.com/smartgwt/...#tiling_custom
My problem is that I cant get the TileGrid to send viewFile requests when I use the custom TileConstructor.
If I dont set a tile constructor everything works fine and the tilegrid viewFile requests.
Am I wrong in using FileItem? Should I use something else in the tile constructor?
TileGrid:
TileConstructor class:
ds.xml
I have a TileGrid similar to the one in http://www.smartclient.com/smartgwte...se/#upload_sql which shows user uploaded pictures from a database, but I want to use a custom TileConstructor like in http://www.smartclient.com/smartgwt/...#tiling_custom
My problem is that I cant get the TileGrid to send viewFile requests when I use the custom TileConstructor.
If I dont set a tile constructor everything works fine and the tilegrid viewFile requests.
Am I wrong in using FileItem? Should I use something else in the tile constructor?
TileGrid:
Code:
DataSource dataSource = DataSource.get("datasource"); final TileGrid mediaTileGrid = new TileGrid(); mediaTileGrid.setWidth("100%"); mediaTileGrid.setHeight(224); mediaTileGrid.setTileWidth(100); mediaTileGrid.setTileHeight(150); mediaTileGrid.setDataSource(dataSource); mediaTileGrid.setAutoFetchData(true); mediaTileGrid.setTileConstructor(AnimalTile.class.getName());
Code:
import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.FileItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; public class AnimalTile extends DynamicForm { public AnimalTile() { setOverflow(Overflow.HIDDEN); setHeight(150); setWidth(200); FileItem fileItem = new FileItem("image"); fileItem.setType("imageFile"); fileItem.setShowFileInline(true); fileItem.setRowSpan(3); fileItem.setCanEdit(false); StaticTextItem commonName = new StaticTextItem("title"); commonName.setShowTitle(false); setFields(fileItem, commonName); } }
Code:
<DataSource ID="datasource" serverConstructor="Servlet"> <fields> <field name="pk" type="sequence" hidden="true" primaryKey="true"/> <field name="title"/> <field name="image" type="imageFile"/> </fields> </DataSource>
Comment