Announcement

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

    Best practice: Accessing fields via DynamicForm.getValue() or via object?

    Hi Isomorphic,

    I'm pretty sure that for the code shown for "Change via object" and "Change via DynamicForm" in this testcase, only the 2nd case is good style or even allowed.
    I also think that I read this somewhere in the docs, but can't seem to find where.

    In this answer you say one is not allowed to change ListGridFields after passing them to a ListGrid via setFields().

    Could you say yes/no to these actions:
    1. DynamicForm:
      1. FormItem.setSomeProperty() after passing the FormItem to a DynamicForm.
      2. FormItem.setValue() after passing the FormItem to a DynamicForm.
      3. FormItem.getValue() after passing the FormItem to a DynamicForm.
    2. ListGrid
      1. ListGridField.setSomeProperty() after passing the ListGridField to a ListGrid.
      2. ListGridField.setValue() (e.g. in some ListGrid-Actionhandler) after passing the ListGridField to a ListGrid.
      3. ListGridField.getValue() (e.g. in some ListGrid-Actionhandler) after passing the ListGridField to a ListGrid.
    Thank you & Best regards
    Blama

    #2
    Calling those FormItem APIs is valid, but note it would not be valid for a FormItem passed as properties (for example, listGridField.setEditorProperties()).

    Calling APIs on a ListGridField after passing to setFields() is invalid. Use ListGrid.setFieldProperty() instead.

    Comment


      #3
      Hi Isomorphic,

      thank you, just the information I needed. Is this also somewhere in the docs? If not, I suggest to add it, perhaps to ListGrid and DynamicForm or their setFields()-methods.
      This is pretty basic and especially in the ListGrid-case users will get this wrong eventually.

      Best regards
      Blama

      Comment


        #4
        Hi Isomorphic,

        I just saw that ListGrid.setFields() already has that information on setting fields properties.

        Best regards
        Blama

        Comment

        Working...
        X