Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DynamicForm addField VS setFields

    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:
    Code:
    List<FormItem> fields = new ArrayList<FormItem>(Arrays.asList(form.getFields()));
    fields.add(newItem);
    form.setFields(fields.toArray(new FormItem[fields.size()]));

    #2
    *bump*

    +1 from me, IMHO the API is inconsistent here.

    Comment

    Working...
    X