@Override
    protected HtmlComponent getComponent(int rowIndex, int columnIndex) {
      Object object = this.objects.get(rowIndex);

      Schema schema = RenderKit.getInstance().findSchema(getEachSchema());
      String layout = getEachLayout();

      MetaObject metaObject = MetaObjectFactory.createObject(object, schema);

      if (columnIndex == 0) {
        this.hiddenValues.addValue(metaObject.getKey().toString());

        PresentationContext newContext = getContext().createSubContext(metaObject);
        newContext.setLayout(layout);
        newContext.setRenderMode(RenderMode.getMode("output"));

        RenderKit kit = RenderKit.getInstance();
        return kit.render(newContext, object);
      } else {
        HtmlActionLink link = new HtmlActionLink();

        String prefix = getInputContext().getMetaObject().getKey().toString();
        link.setName(prefix + "/delete/" + rowIndex);
        link.setText(RenderUtils.getResourceString("renderers.list.management.delete"));

        HtmlTableRow row = getTable().getRows().get(rowIndex);
        link.setController(new RemoveLineController(getTable(), this.hiddenValues, row, prefix));
        return link;
      }
    }
Esempio n. 2
0
  public Schema getSchema() {
    if (this.schema == null && this.schemaName != null) {
      this.schema = RenderKit.getInstance().findSchema(this.schemaName);
    }

    return this.schema;
  }