Hi
I believe that a recent change (say over the last 1 or 2 month) has a negative effect on the method addChildForm on AbstractForm.
I am using that method, as suggested by Larry a while back, to embed a Master/Detail component in an existing form.
e.g.
Now the addChildForm fails on assertion failure "already has a parent"...Code:public static class CapturePreferenceForm extends AbstractForm { public CapturePreferenceForm(final FormModel formModel) { super(formModel, "capturePreferenceForm"); } protected JComponent createFormControl() { TableFormBuilder formBuilder = new TableFormBuilder(getBindingFactory()); formBuilder.add("bla"); formBuilder.row(); Form masterForm = new MyForm(getFormModel(), "myDefaults", MyDefault.class); formBuilder.getLayoutBuilder().cell(masterForm.getControl()); addChildForm(masterForm); return formBuilder.getForm(); } }
Could somebody confirm what has changed and how I should call this method?Code:java.lang.IllegalArgumentException: Child form model '[DefaultFormModel@45f4ae id = 'XXX', buffered = true, enabled = true, dirty = false, validating = true, validationResults = [DefaultValidationResultsModel@c2ccac messages = set[[empty]]]]' already has a parent at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.binding.form.support.AbstractFormModel.addChild(AbstractFormModel.java:239) at org.springframework.richclient.form.AbstractForm.addChildForm(AbstractForm.java:192)
Looks like the model may have changed?
Thanks
Benoit


Reply With Quote