assertEquals(Object.class, fm.getFieldMetadata("readOnly").getPropertyType());
assertTrue(fm.getFieldMetadata("readOnly").isReadOnly());
}
public void testSetFormObjectUpdatesDirtyState() {
final AbstractFormModel fm = getFormModel(new TestBean());
fm.add("simpleProperty");
fm.add("singleSelectListProperty");
assertTrue(!fm.isDirty());
fm.getValueModel("simpleProperty").addValueChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
fm.getValueModel("singleSelectListProperty").setValue(null);
}
});
TestBean newBean = new TestBean();
newBean.setSimpleProperty("simpleProperty");
newBean.setSingleSelectListProperty("singleSelectListProperty");
fm.setFormObject(newBean);
assertEquals(null, fm.getValueModel("singleSelectListProperty").getValue());
assertTrue(fm.isDirty());
fm.getValueModel("singleSelectListProperty").setValue("singleSelectListProperty");
assertTrue(!fm.isDirty());