Creating textfields dynamically

Hi,

First of all,

TextField tx1 = new TextField("");
TextField tx1 = new TextField("");
TextField tx1 = new TextField("");

would give a compile error. I assume you meant

TextField tx1 = new TextField("");
tx1 = new TextField("");
tx1 = new TextField("");

So, your problem is that when you click a validation button, you want to process all these TextFields?
If you add them all to the same layout, you could just iterate through that layout’s components and cast the components to TextFields where appropriate. However, then every TextField in that Layout would be processed. Why not just add the references of the TextFields (or the Properties of the TextFields) to some external Collection? This depends much on the use case.

BR,
Johan