I'm trying to build a form generating class and i might have hit a glitch somewhere in my logic statement.
You have two string arrays.
String[] fieldNames;
String[] fieldTypes;
Both their lengths should be the same. Each value in the fieldName[] corresponds to a value in the fieldTypes[] array.
I want to create various fields depending on the values stated in the fieldTypes array and assign the created fields the name specified in the fieldNames array.e.g.
String[] fieldNames = {"Name", "Phone", "Gender"}
String[] fieldTypes = {"TextFied","ComboBox", "RadioButton"}
The field types and names can vary. They can be whatever you want them to be.
Now, using the above info, how do i assign the fieldNames to the fieldTypes so I can use them in the data processing? i.e
TextField name = new TextField();
ComboBox phone = new ComboBox();
RadioButton gender = new RadioButton();
I've been mulling this over for a week now and there doesn't seem to be any solution to this online. Or rather I haven't been able to find one. I someone could point me in the right direction i'll be greatful