Search in sources :

Example 1 with Column

use of org.apache.ofbiz.widget.model.ModelScreenWidget.Column in project ofbiz-framework by apache.

the class MacroScreenRenderer method renderColumnContainer.

@Override
public void renderColumnContainer(Appendable writer, Map<String, Object> context, ColumnContainer columnContainer) throws IOException {
    String id = columnContainer.getId(context);
    String style = columnContainer.getStyle(context);
    StringBuilder sb = new StringBuilder("<@renderColumnContainerBegin");
    sb.append(" id=\"");
    sb.append(id);
    sb.append("\" style=\"");
    sb.append(style);
    sb.append("\" />");
    executeMacro(writer, sb.toString());
    for (Column column : columnContainer.getColumns()) {
        id = column.getId(context);
        style = column.getStyle(context);
        sb = new StringBuilder("<@renderColumnBegin");
        sb.append(" id=\"");
        sb.append(id);
        sb.append("\" style=\"");
        sb.append(style);
        sb.append("\" />");
        executeMacro(writer, sb.toString());
        for (ModelScreenWidget subWidget : column.getSubWidgets()) {
            try {
                subWidget.renderWidgetString(writer, context, this);
            } catch (GeneralException e) {
                throw new IOException(e);
            }
        }
        executeMacro(writer, "<@renderColumnEnd />");
    }
    executeMacro(writer, "<@renderColumnContainerEnd />");
}
Also used : GeneralException(org.apache.ofbiz.base.util.GeneralException) Column(org.apache.ofbiz.widget.model.ModelScreenWidget.Column) ModelScreenWidget(org.apache.ofbiz.widget.model.ModelScreenWidget) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 GeneralException (org.apache.ofbiz.base.util.GeneralException)1 ModelScreenWidget (org.apache.ofbiz.widget.model.ModelScreenWidget)1 Column (org.apache.ofbiz.widget.model.ModelScreenWidget.Column)1