Announcement

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

    Customizing the form items of DynamicForm bound to dynamic DataSource

    Hello,

    I use SmartGWT 1.5.7.

    I use a DynamicForm that gets configured by a dynamic datasource because the number of fields and their types are unknown in advance.

    I would like to be able to customize the form items created from the DS fields, I have set in DS some extra field attributes that get interpreted by the form items (e.g. width or displayField) but I'd like to go further by being able to use a different type of FormItem.

    In particular, I'd like to use a ListGrid for editing relations rather than a multiple SelectItem.

    So far, I am unable to do so, when I do a form.getFields(), the returned fields are all TextItems created by FormItemFactory.
    So I'm not sure this is even possible.

    Thanks,

    Gael

    #2
    I think I'll try to read the fields from the DataSource and create specific items for few of them.

    Comment


      #3
      In the quick start guide, chapter 5 Data Binding / Custom Binding it says:

      Code:
      Now, all DataSource fields will be shown unless you provide a component field definition where you have called setHidden(true).
      AFAIK, there is no setHidden() method in FormItem but I replaced it by setAttribute("showIf", "false") and it works.

      Comment

      Working...
      X