|Validation for dynamically created fields on WizardPage [message #1827443]
||Thu, 14 May 2020 15:10
| Marie-Saphira Flug
Registered: January 2019
on my WizardPage, there are a numberOfTexts of Text(main, SWT.BORDER). The numberOfTexts is passed to the Constructor of the WizardPage.
The textfields are created in a for loop in createControl(), so they are not fields of the WizardPage.
I want to check if every Text is not empty. So every ModifyListener calls validate(). My ideas for validate():
1. Have a List of all Texts (as field in WizardPage) that gets validated.
2. Use Control composite = ((Composite) this.getControl()).getChildren(); to get all fields (while there are children).
All the examples for validation I found so far use the Texts directly. Is there a better way for validation than one of the above?
Also what to do if the validation differs for each Text?
Powered by FUDForum
. Page generated in 0.01846 seconds