Search in sources :

Example 1 with TableBodyLayout

use of com.revolsys.ui.html.layout.TableBodyLayout in project com.revolsys.open by revolsys.

the class FilterableTableView method initialize.

@Override
public void initialize(final HttpServletRequest request) {
    if (this.searchFields != null) {
        final ElementContainer searchContainer = new ElementContainer(new TableBodyLayout("search", this.model.getColumnCount()));
        add(searchContainer);
        for (final KeySerializer serializer : this.model.getSerializers()) {
            final String name = serializer.getName();
            Element element = this.searchFields.get(name);
            if (element == null) {
                element = NbspElement.INSTANCE;
            } else {
                element = element.clone();
                if (element instanceof Field) {
                    final Field field = (Field) element;
                    field.setRequired(false);
                }
                if (element instanceof TextField) {
                    final TextField textField = (TextField) element;
                    textField.setSize(1);
                }
                if (element instanceof TextAreaField) {
                    final TextAreaField textField = (TextAreaField) element;
                    textField.setRows(1);
                    textField.setCols(1);
                }
            }
            searchContainer.add(element);
        }
    }
    super.initialize(request);
}
Also used : Field(com.revolsys.ui.html.fields.Field) TextField(com.revolsys.ui.html.fields.TextField) TextAreaField(com.revolsys.ui.html.fields.TextAreaField) TableBodyLayout(com.revolsys.ui.html.layout.TableBodyLayout) TextField(com.revolsys.ui.html.fields.TextField) TextAreaField(com.revolsys.ui.html.fields.TextAreaField) KeySerializer(com.revolsys.ui.html.serializer.key.KeySerializer)

Aggregations

Field (com.revolsys.ui.html.fields.Field)1 TextAreaField (com.revolsys.ui.html.fields.TextAreaField)1 TextField (com.revolsys.ui.html.fields.TextField)1 TableBodyLayout (com.revolsys.ui.html.layout.TableBodyLayout)1 KeySerializer (com.revolsys.ui.html.serializer.key.KeySerializer)1