Announcement

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

    SmartClient / SmartGWT docs or setter mismatch for ListGridField.canHide and others

    Hi Isomorphic

    creating this post I noticed that SmartClient ListGridField.canHide is marked as "IR" only (v12.0p_2022-03-31 and newer).
    The SmartGWT setter ListGridField.setCanHide() does not mention this.

    Other setters like for ListGrid.alwaysShowOperatorIcon match here in SmartClient and SmartGWT (see the throws IllegalStateException exception there).

    I have been using this setter in SmartGWT successfully after init, so I think the docs in SmartClient are wrong and should be IRW.

    Can you have a look? A text search in the ListGridField docs for IllegalStateException shows that all setters (allowFilterExpressions, allowFilterOperators, ...) should work after init.

    Best regards
    Blama

    #2
    Hi Blama
    ListGridField.canHide is safe to update at runtime. It being marked as IRW rather than IR is basically wrong (apparently a result of us being overly cautious). We'll update the documentation.

    On your question about Illegal state exceptions: ListGridFields differ from many other objects such as Canvases and FormItems in that they are never created in JavaScript as true SmartClient instances of a class - they are simple JavaScript configuration objects, wrapped for SGWT by the ListGridField class.
    As such they may not throw an exception when you invoke a setter on a property that is not marked as runtime-writeable. The documentation should be accurate though -- the lack of a "W" flag usually implies that there's some initialization logic that needs to run (for example when setFields is called or when a ListGrid is drawn) that isn't guaranteed to run if the attribute is changed at runtime, and as such updating the property at runtime may not behave as expected.

    Comment


      #3
      Hi Isomorphic,

      I think I understand what you mean. I assume though that you mixed up IRW and IR in #2.

      The only problem I can see for the future: If indeed some SmartClient-ListGridFields properties are IR only and you can't let SmartGWT-ListGridFields throw exceptions after init, then you need some method of documenting the IR-characteristic of SmartClient-ListGridFields in the SmartGWT docs. So far you are using the exception to convey this information to the user.

      Best regards
      Blama

      Comment

      Working...
      X