Search in sources :

Example 1 with SetObject

use of com.revolsys.ui.html.view.SetObject in project com.revolsys.open by revolsys.

the class UiBuilderObjectForm method initialize.

@Override
public void initialize(final HttpServletRequest request) {
    for (final String key : this.fieldKeys) {
        if (!getFieldNames().contains(key)) {
            final Element field = this.builder.getAttribute(request, key);
            if (field instanceof SetObject) {
                ((SetObject) field).setObject(this.object);
            }
            if (field != null) {
                if (!getElements().contains(field)) {
                    if (field instanceof HiddenField) {
                        final HiddenField hiddenField = (HiddenField) field;
                        add(hiddenField);
                    } else {
                        final Decorator label = this.builder.getAttributeFormGroupLabel(key, field);
                        this.fieldContainer.add(field, label);
                    }
                }
            }
        }
    }
    this.builder.initializeForm(this, request);
    super.initialize(request);
}
Also used : Decorator(com.revolsys.ui.html.decorator.Decorator) Element(com.revolsys.ui.html.view.Element) HiddenField(com.revolsys.ui.html.fields.HiddenField) SetObject(com.revolsys.ui.html.view.SetObject)

Example 2 with SetObject

use of com.revolsys.ui.html.view.SetObject in project com.revolsys.open by revolsys.

the class HtmlUiBuilderObjectForm method initialize.

@Override
public void initialize(final HttpServletRequest request) {
    for (final String key : this.fieldKeys) {
        if (!getFieldNames().contains(key)) {
            final Element field = this.builder.getAttribute(request, key);
            if (field instanceof SetObject) {
                ((SetObject) field).setObject(this.object);
            }
            if (field != null) {
                if (!getElements().contains(field)) {
                    final Decorator label = this.builder.getAttributeLabel(key, field);
                    add(field, label);
                }
            }
        }
    }
    this.builder.initializeForm(this, request);
    super.initialize(request);
}
Also used : Decorator(com.revolsys.ui.html.decorator.Decorator) Element(com.revolsys.ui.html.view.Element) SetObject(com.revolsys.ui.html.view.SetObject)

Aggregations

Decorator (com.revolsys.ui.html.decorator.Decorator)2 Element (com.revolsys.ui.html.view.Element)2 SetObject (com.revolsys.ui.html.view.SetObject)2 HiddenField (com.revolsys.ui.html.fields.HiddenField)1