Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TileGrid Issue while populating data in tiles from datasource

    We are trying to create a tile grid. As per data source records, tiles are created equal to number of records in data source.
    But data from data source is not populated in tiles. Tile I am creating is a Layout which has multiple dynamic forms in it.
    Any help is appreciated.

    #2
    With the default SimpleTile class, data is automatically populated. For more complicated tiles, there is no way for the framework to magically populate an arbitrary set of widgets with data - your code needs to do it. Just call getTileRecord() when your tile is being constructed, and apply the data in whatever way you like.

    Comment


      #3
      We are using Beanfactory for creating tilegrid.

      public class CustomTileGrid extends TileGrid {

      public interface CardDetailMetaFactory extends BeanFactory.MetaFactory {
      BeanFactory<CardDetailTile> getCardDetailTileFactory();
      }
      // Here CardDetailTile is out tile class.
      public CustomTileGrid(DataSource cardViewDataSource, CardDetailTile tileType) {
      setDataSource(dataSource);
      setAutoFetchData(true);
      GWT.create(CardDetailMetaFactory.class);
      setTileConstructor(tileType.getClass().getName());
      }
      }

      Where I should use getTileRecord() because in above code tiles are internally created.

      Comment


        #4
        You can supply the record to your custom tile class in an override of getTile().

        You could also simply create your tile instances there rather than take the BeanFactory approach.

        Comment


          #5
          for simply create your tile instances there rather than take the BeanFactory approach : could you please help me any example or bit more details. I tried but it did not work out or I was not on right track.

          Comment


            #6
            So again, you override getTile() and create tiles there. Further details are in the docs for that method, and the related docs they link to.

            Comment

            Working...
            X