Package com.tll.client.bind

Examples of com.tll.client.bind.Binding


   * @throws BindingException When the binding creation fails
   */
  static Binding createBinding(Model model, IConverter<Object, Object> modelConverter, String modelProp,
      IPropertyChangeListener modelChangeListener, IFieldWidget<?> fw, IConverter<Object, Object> fieldConverter,
      IPropertyChangeListener fieldChangeListener) throws BindingException {
    final Binding b =
      new Binding(model, modelProp, modelConverter, null, null, fw, IBindableWidget.PROPERTY_VALUE, fieldConverter,
          fw, fw.getErrorHandler());
    if(modelChangeListener != null) b.addPropertyChangeListener(modelChangeListener, true);
    if(fieldChangeListener != null) b.addPropertyChangeListener(fieldChangeListener, false);
    return b;
  }
View Full Code Here


   * @throws BindingException When the binding creation fails
   */
  static Binding createBindings(FieldGroup group, Model model, ModelChangeTracker modelChangeTracker)
  throws BindingException {
    Log.debug("Binding field group: " + group + " to model [" + model + "]..");
    final Binding b = new Binding();
    // create bindings for all provided field widgets in the root field group
    for(final IFieldWidget<?> fw : group.getFieldWidgets(null)) {
      // clear the current value to re-mark the field's initial value
      fw.clearValue();
      try {
        Log.debug("Binding field: " + fw + " to model prop [" + fw.getPropertyName() + "]..");
        final Binding cb = createBinding(model, null, fw.getPropertyName(), modelChangeTracker, fw, null, null);
        b.getChildren().add(cb);
      }
      catch(final Exception e) {
        Log.warn("Skipping field binding for property: " + fw.getPropertyName() + " due to " + e.getMessage());
      }
View Full Code Here

    ensureSet();
    Log.debug("Creating bindings for: " + widget);

    final FieldGroup group = widget.getFieldGroup();
    final List<Binding> bchildren = binding.getChildren();
    Binding b;

    for(final IFieldWidget<?> fw : group.getFieldWidgets(null)) {
      // clear the current value to re-mark the field's initial value
      fw.clearValue();
      try {
        Log.debug("Binding field: " + fw + " to model prop [" + fw.getPropertyName() + "]..");
        b = createFieldBinding(fw);
        bchildren.add(b);
      }
      catch(final BindingException e) {
        Log.warn("Skipping field binding for property: " + fw.getPropertyName() + " due to " + e.getMessage());
      }
    }

    // bind the indexed
    final IIndexedFieldBoundWidget[] indexedWidgets = widget.getIndexedChildren();
    if(indexedWidgets != null) {
      for(final IIndexedFieldBoundWidget iw : indexedWidgets) {
        Log.debug("Creating indexed bindings for: " + iw);
        // add binding to the many value collection only
        b =
          new Binding(widget.getModel(), iw.getIndexedPropertyName(), null, null, null, iw,
              IBindableWidget.PROPERTY_VALUE, null, null, null);
        binding.getChildren().add(b);
      }
    }
View Full Code Here

TOP

Related Classes of com.tll.client.bind.Binding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.