@Test public void testBinding() { BeanMetaData beanMetaData = Wicketopia.get().getBeanMetaData(EditableBean.class); EditableBean bean = new EditableBean(); final IModel<Boolean> model = new PropertyModel<Boolean>(bean, "bool"); bean.setBool(true); Context context = new Context(Context.CREATE); EditorBuilder propertyEditor = CheckBoxPropertyEditor.getProvider().createPropertyEditor("editor", beanMetaData.getPropertyMetaData("bool"), model, context); final EditorTestPage page = new EditorTestPage(propertyEditor.build()); tester.startPage(page); tester.assertModelValue("form:editor:editor", Boolean.TRUE); FormTester formTester = tester.newFormTester("form"); formTester.setValue("editor:editor", false); formTester.submit(); tester.assertModelValue("form:editor:editor", Boolean.FALSE); }
public static PropertyEditorProvider getProvider() { return PROVIDER; }
CheckBoxPropertyEditor extends AbstractFormComponentPropertyEditor { public static PropertyEditorProvider getProvider() { return PROVIDER; } }
CheckBoxPropertyEditor extends AbstractFormComponentPropertyEditor { public static PropertyEditorProvider getProvider() { return PROVIDER; } CheckBoxPropertyEditor(String id, PropertyMetaData propertyMetaData, CheckBox checkBox); }
CheckBoxPropertyEditor extends AbstractFormComponentPropertyEditor { public static PropertyEditorProvider getProvider() { return PROVIDER; } CheckBoxPropertyEditor(String id, PropertyMetaData propertyMetaData, CheckBox checkBox); static PropertyEditorProvider getProvider(); @Override void required(boolean required); }
CheckBoxPropertyEditor extends AbstractFormComponentPropertyEditor { public static PropertyEditorProvider getProvider() { return PROVIDER; } CheckBoxPropertyEditor(String id, PropertyMetaData propertyMetaData, CheckBox checkBox); static PropertyEditorProvider getProvider(); @Override void required(boolean required); static final String TYPE_NAME; }