Package org.springframework.binding.form

Examples of org.springframework.binding.form.ValidatingFormModel


        getPrintFieldsCommand(), getCommitCommand(), getNewFormObjectCommand(), getRevertCommand(),
        getLogFormModelPropertyChangeCommand() };
  }

  public void registerFormModelPropertyChangeListener() {
    ValidatingFormModel formModel = getFormModel();
    formModel.addPropertyChangeListener(FormModel.COMMITTABLE_PROPERTY, formModelPropertyChangeListener);
    formModel.addPropertyChangeListener(FormModel.DIRTY_PROPERTY, formModelPropertyChangeListener);
    formModel.addPropertyChangeListener(FormModel.ENABLED_PROPERTY, formModelPropertyChangeListener);
    formModel.addPropertyChangeListener(FormModel.READONLY_PROPERTY, formModelPropertyChangeListener);
    formModel.addPropertyChangeListener(ValidatingFormModel.VALIDATING_PROPERTY, formModelPropertyChangeListener);
  }
View Full Code Here


    formModel.addPropertyChangeListener(FormModel.READONLY_PROPERTY, formModelPropertyChangeListener);
    formModel.addPropertyChangeListener(ValidatingFormModel.VALIDATING_PROPERTY, formModelPropertyChangeListener);
  }

  public void unregisterFormModelPropertyChangeListener() {
    ValidatingFormModel formModel = getFormModel();
    formModel.removePropertyChangeListener(FormModel.COMMITTABLE_PROPERTY, formModelPropertyChangeListener);
    formModel.removePropertyChangeListener(FormModel.DIRTY_PROPERTY, formModelPropertyChangeListener);
    formModel.removePropertyChangeListener(FormModel.ENABLED_PROPERTY, formModelPropertyChangeListener);
    formModel.removePropertyChangeListener(FormModel.READONLY_PROPERTY, formModelPropertyChangeListener);
    formModel
        .removePropertyChangeListener(ValidatingFormModel.VALIDATING_PROPERTY, formModelPropertyChangeListener);
  }
View Full Code Here

     */
    public void testAddChildForm() {
        TestBean testBean = new TestBean();
        testBean.setNestedProperty(new TestBean());
        HierarchicalFormModel model = new DefaultFormModel(testBean);
        ValidatingFormModel childModel = FormModelHelper.createChildPageFormModel(model, "test", "nestedProperty");
        AbstractForm form = new TestAbstractForm(model);
        form.addChildForm(new TestAbstractForm(childModel));
    }
View Full Code Here

        }

        HierarchicalFormModel parentModel = new DefaultFormModel();
        assertNull(FormModelHelper.getChild(parentModel, "testChildName"));

        final ValidatingFormModel childFormModel = FormModelHelper.createFormModel(new Object(), "testChildName");
        parentModel.addChild(childFormModel);

        assertNotNull(FormModelHelper.getChild(parentModel, "testChildName"));
        assertNull(FormModelHelper.getChild(parentModel, "bogusChildName"));
    }
View Full Code Here

        // Now construct the dirty tracking model
        Class collectionType = getMasterCollectionType( propertyVM );

        collectionVM = new DirtyTrackingDCBCVM( propertyVM, collectionType );
        ValidatingFormModel formModel = FormModelHelper.createChildPageFormModel( parentFormModel, formId,
                collectionVM);
        setFormModel( formModel );

        // Install a handler to detect when the parents form model changes
        propertyVM.addValueChangeListener(parentFormPropertyChangeHandler);
View Full Code Here

        return createChildPageFormModel(parentModel, null);
    }

    public static ValidatingFormModel createChildPageFormModel(HierarchicalFormModel parentModel,
                                                               String childPageName) {
        ValidatingFormModel child = createFormModel(parentModel.getFormObjectHolder());
        child.setId(childPageName);
        parentModel.addChild(child);
        return child;
    }
View Full Code Here

        return createChildPageFormModel(parentModel, childPageName, childValueModel);
    }

    public static ValidatingFormModel createChildPageFormModel(HierarchicalFormModel parentModel, String childPageName,
                                                               ValueModel childFormObjectHolder) {
        ValidatingFormModel child = createFormModel(childFormObjectHolder);
        child.setId(childPageName);
        parentModel.addChild(child);
        return child;
    }
View Full Code Here

  protected <S> void bindSubForm( @NotNull TableFormBuilder builder, @NotNull @NonNls String property, @NotNull FormFactory<S> factory ) {
    bindSubForm( builder, property, factory, true );
  }

  protected <S> void bindSubForm( @NotNull TableFormBuilder builder, @NotNull @NonNls String property, @NotNull FormFactory<S> factory, boolean buffered ) {
    ValidatingFormModel childModel = FormModelHelper.createFormModel( getFormModel().getValueModel( property ), buffered, null );
    getFormModel().addChild( childModel );

    ExtendedForm<? extends S> childForm = factory.createForm( childModel );
    addChildForm( childForm );
View Full Code Here

    }
  }

  @NotNull
  public Form createForm( @NotNull Object bean ) {
    ValidatingFormModel formModel = FormModelHelper.createFormModel( bean );

    Class<Form> formClass = getFormClass( bean.getClass() );
    try {
      return ( Form ) BeanUtils.instantiateClass( formClass.getDeclaredConstructor( ValidatingFormModel.class ), new Object[]{formModel} );
    } catch ( NoSuchMethodException e ) {
View Full Code Here

TOP

Related Classes of org.springframework.binding.form.ValidatingFormModel

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.