@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; } }
@Override protected Layout getLayout(Object object, Class type) { MetaObject metaObject = getInputContext().getMetaObject(); return new ManageableListLayout((Collection) metaObject.getObject()); }