PDA

View Full Version : Bug in WizardDialog


claudio
Aug 16th, 2004, 12:40 PM
Hi,

i was testing the WizardDialog in my Application and came across
following Bug. You can reproduce it in the sample Application too.

1. Start Petclinic Sample Application
2. Make a new owner ( Strg+O)
3. Close the dialog with the "dialog close button" on the upper right
4. Make (again) a new owner ( Strg+O)

after this, i get this IllegalArgumentException:


SCHWERWIEGEND: Child model by name 'generalPage' already exists
java.lang.IllegalArgumentException: Child model by name 'generalPage' already exists
at org.springframework.util.Assert.isTrue(Assert.java :137)
at org.springframework.rules.values.CompoundFormModel .addChildModel(CompoundFormModel.java:123)
at org.springframework.rules.values.CompoundFormModel .createChild(CompoundFormModel.java:79)
at org.springframework.richclient.forms.SwingFormMode l.createChildPageFormModel(SwingFormModel.java:117 )
at org.springframework.richclient.forms.AbstractFormP age.<init>(AbstractFormPage.java:76)
at org.springframework.richclient.samples.petclinic.u i.OwnerGeneralForm.<init>(OwnerGeneralForm.java:33)
at org.springframework.richclient.samples.petclinic.u i.NewOwnerWizard$OwnerGeneralWizardPage.<init>(NewOwnerWizard.java:52)
at org.springframework.richclient.samples.petclinic.u i.NewOwnerWizard.addPages(NewOwnerWizard.java:45)
at org.springframework.richclient.wizard.WizardDialog .createTitledDialogContentPane(WizardDialog.java:8 6)
at org.springframework.richclient.dialog.TitledApplic ationDialog.createDialogContentPane(TitledApplicat ionDialog.java:135)
at org.springframework.richclient.dialog.TitledApplic ationDialog.addDialogComponents(TitledApplicationD ialog.java:124)
at org.springframework.richclient.dialog.ApplicationD ialog.createDialog(ApplicationDialog.java:278)
at org.springframework.richclient.dialog.ApplicationD ialog.showDialog(ApplicationDialog.java:247)
at org.springframework.richclient.samples.petclinic.u i.NewOwnerWizard.execute(NewOwnerWizard.java:86)[l ist][/list]
.....
.....



I started to debug, but i'm not sure if it is a SwingFormModel.createChildPageFormModel(SwingFormM odel) or a Wizard bug :roll:

siu
Claudio


ps: is there a bug tracking or something?

Keith Donald
Aug 16th, 2004, 12:53 PM
Claudio,

Good catch. I will investigate this promptly. Yes, feel free to open JIRA issues for these at the www.springframework.org site.

Thanks,
Keith

Keith Donald
Aug 17th, 2004, 09:35 AM
The problem is the dialog -- on closing with the X close button -- is being disposed, and all resources released. On a successive dialog open, the dialog recreates itself, causing recreation of all the pages and page form models. The problem is the wizard form model -- instance of a compound form model -- lives on beyond a single dialog session, and it's complaining it's already been configured.

Keith Donald
Aug 17th, 2004, 02:17 PM
Claudio this should be fixed now; thanks...

claudio
Aug 17th, 2004, 02:59 PM
Keith,

THANKS!!
Saw the JIRA email.

I was not sure if i could change the default close action of the ApplicationDialog, so I came up with this solution:


public WizardDialog(Wizard wizard) {
super(null, null, CloseAction.HIDE);
....
}



Hope to catch the next one by myself :wink:

Claudio