Add FormItem dynamically to DynamicForm using SmartGWT

I would like to add a FormItem to DynamicForm in a SmartGWT form, but all I can find is the setItems method, which adds all the FormItem of the form, so it can only be used to initialize the form. Did I miss something?

My form contains a TextItem, and every time the user enters a new line and checks, a new CheckButton is added.

+4
source share
1 answer

The best approach depends on what you want to do:

  • Dynamically displayed item? Add it to the form during initialization, but hidden, then show () later

  • repeating form like built-in FilterBuilder component? Just add a series of DynamicForms to your layout, think about linking them together with ValuesManager

  • something else? Consider either # 2 above, or setItems () can be used as a means of providing only one new element to the form, just specify a new array of FormItems elements, including those elements that you already have. The form will automatically save the current element values.

+4
source

Source: https://habr.com/ru/post/1380251/


All Articles