Hi,
Is there a reason why the DynamicForm API does not offer an addField(FormItem item) method but only setFields(FormItem... items) ?
It will avoid code like this when we want to add fields to a form that already has items:
Is there a reason why the DynamicForm API does not offer an addField(FormItem item) method but only setFields(FormItem... items) ?
It will avoid code like this when we want to add fields to a form that already has items:
Code:
List<FormItem> fields = new ArrayList<FormItem>(Arrays.asList(form.getFields())); fields.add(newItem); form.setFields(fields.toArray(new FormItem[fields.size()]));
Comment