Announcement

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

    DynamicForm Questions

    Hello,

    I am trying to organize better my forms, so I have some questions about layout for DynamicForms

    1 - Is there built in group layouts in DynamicForms? to group some fields together and have some label to this visual group?
    2 - If I change the X and Y absolute value for some field, the original field place stays as a "hole", is there a way to tell the next field to swap and fill this hole?
    3 - Is there a way to make the DynamicForm header dynamic? to use the data.name for example? instead of having it fixed like this? {type:"header", defaultValue:"Company"}
    4 - How do I re-order the fields inside the DynamicForm? I am using schemaBean as you can see:

    beanClassName="com.wazollc.alphatheory.hibernate.bo.CompanyBO"
    schemaBean="com.wazollc.alphatheory.hibernate.bo.CompanyBO"


    and in the dynamicForm I set it with useAllDataSourceFields:true, so it will automatically build all fields for my Bean, but how can I re order it? I noticed it obey the field definition in the datasource but not the field denifition in the fields property on javascript.

    Can you suggest a smart way to solve these issues?

    thank you.
    Last edited by ccarneiro; 27 Jun 2016, 16:17.

    #2
    Originally posted by ccarneiro View Post
    1 - Is there built in group layouts in DynamicForms? to group some fields together and have some label to this visual group?
    see DynamicForm.isGroup/groupTitle
    Originally posted by ccarneiro View Post
    3 - Is there a way to make the DynamicForm header dynamic? to use the data.name for example? instead of having it fixed like this? {type:"header", defaultValue:"Company"}
    headerItem.setValue("foo")

    Comment


      #3
      Hi ccarneiro,

      if splitting an existing DynamicForm, you'll almost guaranteed also want to look at ValuesManager if you are splitting an existing 1-group DynamicForm into many logical subgroups. Splitting into sections is also possible.

      Best regards
      Blama

      Comment


        #4
        Thank you Blama and claudiobosticco .

        Are these the ways I have to group fields inside a dynamic form? I liked the visual result of DynamicForm.isGroup/groupTitle but as I can see, it only works for the entire form? can I use this grouping to divide the fields inside the same form? or should I create different forms for each group I want to group and point to the same datasource?

        I tried with sections as well as Blama suggested but the visual result isn't the desired, I am still having problems with the ordering of the fields, the fields are auto generated based on the datasource, how can I re order them so I can fix this problem? take a look on this video, you notice this is creating the selection but it is only hiding and showing the components, should I create another section for the other fields?

        https://dl.dropboxusercontent.com/u/...t_sections.mov

        Comment


          #5
          Hi ccarneiro,

          have a look at ValuesManager and read the introducing docs. This is most likely what you want.
          All DynamicForms (one DynamicForm per group) point to the same DataSource the ValuesManager does.
          All operations like fetch() and save() are executed on the ValuesManager instance (no myDF.fetch()).

          Best regards
          Blama

          Comment


            #6
            PS: Regarding the ordering I can't help. I always list all fields I want explicitly, as IMHO you'll have to do this anyway because the cases you are happy with the default are very very rare.
            If you use a ValuesManager, you'll definitely have to do this, as you have to divide the fields between your DynamicForms.

            Comment


              #7
              Thank you Blama, looking into the documentation, ValuesManager is what I need yes, I can have a DynamicForm for each group.
              About ordering, I am trying to generate the fields based on the hibernate Datasource schema bean, it is sad that re-declaring the fields in some order inside the fields[] in javascript doesn't change the order in the interface, in the end, the order that changes in the interface is the declared order of the field in the bean/datasource =/

              Comment


                #8
                In addition to the points made by community members above (thanks guys!):

                1. use a CanvasItem to embed one form into another. So your "group" is just a DynamicForm with isGroup set, potentially embedded in another form via a CanvasItem (depending on how you want the layout to look).

                2. although you need to list the fields you want in a given "group" (DynamicForm instance), assuming you are using DataSources, the field name is all you specify - title, data type, validators etc come from the DataSource. So there is no redundancy. See the DataBinding chapter of the QuickStart if this is not clear.

                Comment


                  #9
                  Thank you all guys, I am being able to reach the desired grouping with multiple instances of DynamicForms and ValuesManager.

                  Can I take this opportunity and ask another question? is there a way to use a label inside the DynamicForm for one of the fields? It always user a textbox even if it is read only for example.

                  Comment


                    #10
                    Originally posted by ccarneiro View Post
                    Thank you all guys, I am being able to reach the desired grouping with multiple instances of DynamicForms and ValuesManager.

                    Can I take this opportunity and ask another question? is there a way to use a label inside the DynamicForm for one of the fields? It always user a textbox even if it is read only for example.
                    maybe do you mean something like a BlurbItem?
                    class BlurbItem extends FormItem
                    FormItem intended for inserting blurbs of instructional HTML into DynamicForms.
                    Set the defaultValue of this item to the HTML you want to embed in the form.

                    Comment


                      #11
                      claudiobosticco , this is what I was looking for: type:"staticText", I had some date fields that always showed as date componentes even if disabled, and for other text fields where I didn't want text fields as well, adding this prop, it will show as label, thank you.

                      Comment

                      Working...