I am writing an application in wich I must be able to add components with their configuration to some objects.
All components have a common part (id, name, position,...) and a component type specific configuration which is stored in component specific database tables.
I want to create a window with a form for the complete component. The user should enter the common data and use a combobox to select the type of the component which should display the type specific part of the form.
Currently I am thinking about using several forms:
- I read the forum and as far as I understand adding/removing fields from a form seems to be no good idea. By the way it could be that I have the same field names in the component-specific forms.
- Placing the information in fieldsets and using enable/disable + hide/show does not work either because the validation of the form works on the disabled fields, too - so if the user does not enter information for a specific component type the form will not be submitted.
I could use a submit button to start the validation of both forms and then retrieve the values and submit them by JSON....
- One for the common part
- One for each component type (using a card-layout to only show the selected form)
Has anybody tried to do this?
What are the problems to expect?