Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Scout/Concepts/WrappedFormField"
(→Description) |
|||
Line 9: | Line 9: | ||
A WrappedFormField is to show another form in this form. | A WrappedFormField is to show another form in this form. | ||
− | + | Two methods are useful to handle the {{ScoutLink|Concepts|Form|AbstractForm}} that will be embedded: | |
* getInnerForm() | * getInnerForm() | ||
* setInnerForm() | * setInnerForm() | ||
− | use | + | |
− | + | When you choose to embed a form in another form, you are responsible of the lifecycle of the inner-form. This mean that you need to initialize, import/export the data, validate the form manually. Depending on your use case, you might want to reuse some of the existing function. | |
+ | |||
+ | Here is a snippet showing how you can set a form on a WrappedFormField: | ||
+ | <source lang="java"> | ||
+ | MyForm form = new MyForm(); | ||
+ | |||
+ | //formfield is the WrappedFormField field. | ||
+ | formfield.setInnerForm(form); | ||
+ | form.setHandler(new NullFormHandler()); | ||
+ | form.initForm(); // Must initialize inner form for fields to be initialized | ||
+ | |||
+ | //additionally it is possible import data from an MyFormData formdata: | ||
+ | form.importFormData(formData); | ||
+ | </source> | ||
== Properties == | == Properties == |
Revision as of 03:59, 12 September 2013
The Scout documentation has been moved to https://eclipsescout.github.io/.
Type of The Scout documentation has been moved to https://eclipsescout.github.io/. to display a The Scout documentation has been moved to https://eclipsescout.github.io/..
- implements: The Scout documentation has been moved to https://eclipsescout.github.io/.
- extends: The Scout documentation has been moved to https://eclipsescout.github.io/.
Contents
Description
A WrappedFormField is to show another form in this form.
Two methods are useful to handle the The Scout documentation has been moved to https://eclipsescout.github.io/. that will be embedded:
- getInnerForm()
- setInnerForm()
When you choose to embed a form in another form, you are responsible of the lifecycle of the inner-form. This mean that you need to initialize, import/export the data, validate the form manually. Depending on your use case, you might want to reuse some of the existing function.
Here is a snippet showing how you can set a form on a WrappedFormField:
MyForm form = new MyForm(); //formfield is the WrappedFormField field. formfield.setInnerForm(form); form.setHandler(new NullFormHandler()); form.initForm(); // Must initialize inner form for fields to be initialized //additionally it is possible import data from an MyFormData formdata: form.importFormData(formData);
Properties
Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.
See also The Scout documentation has been moved to https://eclipsescout.github.io/. for the properties that all fields have in common.
Events
Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.
See also The Scout documentation has been moved to https://eclipsescout.github.io/. for the events that all fields have in common.
See Also
- The Scout documentation has been moved to https://eclipsescout.github.io/.