Catalin Sanda
Sep 20th, 2004, 05:33 AM
Hello,
I have a question regarding the NestingFormModel/SwingFromModel. What I need to do is to edit an object in a main form, which has a subform containing another object (a property from the object in the main form) of the same type (i’m trying to model a supervisor-employee type self-join). So here is what I do:
I create a nesting form model for my bean:
NestingFormModel nestingFormModel = SwingFormModel.createCompoundFormModel( nomenclatorBean );
I create a SwingFormModel which encapsulates the nomenclatorBean:
formModel = SwingFormModel.createChildPageFormModel( nestingFormModel, "Main Page" );
I register a new CustomPropertyEditor for my “supervisor” property and create a new SwingFormModel for that property:
formModel.registerCustomEditor( "supervisor",new NomenclatorLOVCustomPropertyEditor(SwingFormModel. createChildPageFormModel( nestingFormModel, "Supervisor", "supervisor" )));
In the CustomEditor I create a new form on which I try to bind components to the child form model, but the framework binds them directly to the parent object (employee) not the child object (supervisor). Both the employee and supervisor have a property called "code". The current implementation also creates problems when it comes to labels and validation error messages.
I would greatly appreciate a quick response, because we are working on a large 3-tier application and we are a little behind schedule.
Thanks in advance,
Catalin Sanda
I have a question regarding the NestingFormModel/SwingFromModel. What I need to do is to edit an object in a main form, which has a subform containing another object (a property from the object in the main form) of the same type (i’m trying to model a supervisor-employee type self-join). So here is what I do:
I create a nesting form model for my bean:
NestingFormModel nestingFormModel = SwingFormModel.createCompoundFormModel( nomenclatorBean );
I create a SwingFormModel which encapsulates the nomenclatorBean:
formModel = SwingFormModel.createChildPageFormModel( nestingFormModel, "Main Page" );
I register a new CustomPropertyEditor for my “supervisor” property and create a new SwingFormModel for that property:
formModel.registerCustomEditor( "supervisor",new NomenclatorLOVCustomPropertyEditor(SwingFormModel. createChildPageFormModel( nestingFormModel, "Supervisor", "supervisor" )));
In the CustomEditor I create a new form on which I try to bind components to the child form model, but the framework binds them directly to the parent object (employee) not the child object (supervisor). Both the employee and supervisor have a property called "code". The current implementation also creates problems when it comes to labels and validation error messages.
I would greatly appreciate a quick response, because we are working on a large 3-tier application and we are a little behind schedule.
Thanks in advance,
Catalin Sanda