示例#1
0
 public void setupBindingRenderer(Component comp, DataBinder binder) {
   if (comp instanceof Row) {
     final Row row = (Row) comp;
     final Grid grid = row.getGrid();
     if (grid.getRowRenderer() == null) {
       grid.setRowRenderer(new BindingRowRenderer(row, binder));
     }
   }
 }
示例#2
0
  public void doAfterCompose(Component comp) throws Exception {
    super.doAfterCompose(comp);
    Session session =
        ServiceLocator.getNeracaDenormalHome().getSessionFactory().getCurrentSession();

    session.beginTransaction();

    List<hibernate.homendomain.NeracaDenormal> dnhbm =
        session.createQuery("from hibernate.homendomain.NeracaDenormal").list();

    session.getTransaction().commit();
    //		System.out.println(ServiceLocator.getNeracaDenormalHome().findById(1));
    final Component parent = comp;
    List<NeracaDenormal> l = new ArrayList<NeracaDenormal>();
    for (hibernate.homendomain.NeracaDenormal dnn : dnhbm) {
      l.add(
          new NeracaDenormal(
              dnn.getDaerah(),
              dnn.getTahun(),
              dnn.getLaporan(),
              dnn.getId0(),
              dnn.getId1(),
              dnn.getId2(),
              dnn.getId3(),
              dnn.getId4(),
              dnn.getUraian(),
              dnn.getRupiah(),
              dnn.getTipeInput()));
    }
    //		l.addAll(NeracaDao.getNeracas());
    final List<Integer> idxParentAdd = Arrays.asList(2, 6, 11, 15);
    final List<Integer> idxLastDetail = Arrays.asList(4, 8, 13, 17);
    final ListModelList<NeracaDenormal> listModel = new ListModelList<NeracaDenormal>(l);
    grid1.setModel(listModel);
    NeracaRowRenderer nrr =
        new NeracaRowRenderer(listModel, grid1, idxParentAdd, idxLastDetail, btnSave);
    grid1.setRowRenderer(nrr);
  }
    private Grid appendGridItems(Row row, TaskQualityForm taskQualityForm) {
        Grid gridItems = new Grid();

        gridItems.setMold("paging");
        gridItems.setPageSize(5);
        gridItems.setFixedLayout(true);

        renderColumns(gridItems);

        gridItems.setRowRenderer(getTaskQualityFormItemsRowRenderer());
        gridItems.setModel(new SimpleListModel(taskQualityForm
                .getTaskQualityFormItems().toArray()));

        return gridItems;
    }