Announcement

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

    accessing the fields of a DetailViewer

    How do I access the field definitions used by a DetailViewer, so that I can configure them?

    They are automatically configured (somehow) when I bind a DS to the DetailViewer, and I also see setFields(...), but I do not see either getFields(...) or getField(..). (These are the methods I use to do the same for ListGrids.)

    #2
    What are you trying to do? Generally, if you want to override field properties on any DataBoundComponent, add field definitions containing just the properties you want to override (and consider useAllDataSourceFields depending on whether you want the full set of fields or just the ones you specify).

    Comment


      #3
      There are many cases when I want to modify a few things on the fields, without completely re-creating then. I can do this on other DataBound components by getting the field using getField() and configuring it, but this API seems to be missing on this specific class.

      * * *

      Anyway, this does not matter any more, since (because of the lack of this and other features) I stopped using DetailViewer, and started using the much more feature-complete DynamicForm instead.

      Comment


        #4
        Specifying override properties does not require "completely recreating" the fields. You only need to specify the properties you want to override.

        Comment


          #5
          Two reasons:

          1.

          I have had bad experiences with this, on the DS level.
          (Overriding only some parameters of fields, loosing some other.)

          Therefore, I have stopped trusting these mechanisms.
          (Or is this a completely different level, with completely different behavior?)

          2.

          How do I override only some of the properties? For a starter, I need to create a specific subclass of FormItem, since FormItem in itself should not be instantiated, right? On the level I would like to modify the properties, I do not even know the required type, so this is already difficult. But if I work this out, do you say that I

          - bind the DS
          - create a half-configured FormItem
          - set this formItem with setFields() (or setItems, or whatever it's called there)
          - the auto-generated and the user supplied formItems merge
          - if I query the formItem with getField(name), I get back the merged item?

          Does this work this way?

          Comment


            #6
            It is a separate mechanism, and yes that's how it's intended to be used.

            Comment

            Working...
            X