Click
  1. Click
  2. CLK-379

The ability to set the number of columns in a FieldSet has been removed, consider re-implementation

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 M2
    • Fix Version/s: 1.5 M2
    • Component/s: core
    • Labels:
      None

      Description

      This code was supported in click 1.4.1

      fieldSet.setColumns(3);

      Allowing a field set to have a different column layout to the form.

      It is no longer supported in 1.5 M2.

        Activity

        Hide
        Bob Schellink added a comment -

        Hi Ben,

        This is a little tricky as FieldSet in 1.4 laid out its fields in a grid like fashion, which is why setColumns worked. The advantage here was that its easy to add fields and have it automatically laid out in a Table. The disadvantage is that it was limited to Fields only.

        In 1.5 with the introduction of Container, FieldSet does not layout its fields anymore. The advantage here is that any Control can be added to FieldSet including Tables, Grids etc.

        So perhaps we should look at adding some building blocks for doing layouts. For example having a Grid control could alleviate this issue somewhat:

        From this:

        FieldSet fieldSet = new FieldSet("fieldSet");
        fieldSet.setColumns(2);
        fieldSet.add(new TextField("field1"));
        fieldSet.add(new TextField("field2"));

        to this:

        FieldSet fieldSet = new FieldSet("fieldSet");
        Grid grid = new Grid();
        fieldSet.add(grid);
        grid.setColumns(2);
        grid.add(new TextField("field1"));
        grid.add(new TextField("field2"));

        Would this work OK?

        Show
        Bob Schellink added a comment - Hi Ben, This is a little tricky as FieldSet in 1.4 laid out its fields in a grid like fashion, which is why setColumns worked. The advantage here was that its easy to add fields and have it automatically laid out in a Table. The disadvantage is that it was limited to Fields only. In 1.5 with the introduction of Container, FieldSet does not layout its fields anymore. The advantage here is that any Control can be added to FieldSet including Tables, Grids etc. So perhaps we should look at adding some building blocks for doing layouts. For example having a Grid control could alleviate this issue somewhat: From this: FieldSet fieldSet = new FieldSet("fieldSet"); fieldSet.setColumns(2); fieldSet.add(new TextField("field1")); fieldSet.add(new TextField("field2")); to this: FieldSet fieldSet = new FieldSet("fieldSet"); Grid grid = new Grid(); fieldSet.add(grid); grid.setColumns(2); grid.add(new TextField("field1")); grid.add(new TextField("field2")); Would this work OK?
        Hide
        Malcolm Edgar added a comment -

        I think we need to get the old behaviour working in Form as we need to support existing applications.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - I think we need to get the old behaviour working in Form as we need to support existing applications. regards Malcolm
        Hide
        Bob Schellink added a comment -

        Alright.

        If we re-introduce the FieldSet#setColumn method we need to document that this method serves as a hint to FieldSet parent Containers, and could be ignored.

        For example, Form would act upon this value, but BasicForm would ignore it.

        Show
        Bob Schellink added a comment - Alright. If we re-introduce the FieldSet#setColumn method we need to document that this method serves as a hint to FieldSet parent Containers, and could be ignored. For example, Form would act upon this value, but BasicForm would ignore it.
        Hide
        Malcolm Edgar added a comment -

        Yes that would be good. You can assign this issue to me if you are busy Bob.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Yes that would be good. You can assign this issue to me if you are busy Bob. regards Malcolm Edgar
        Hide
        Bob Schellink added a comment -

        Its already assigned to you

        Show
        Bob Schellink added a comment - Its already assigned to you
        Hide
        Bob Schellink added a comment -

        Restored ability to set columns on FieldSet. The FieldSet#columns acts as a hint, which Form uses at render time.

        Will be part of 1.5M2

        Show
        Bob Schellink added a comment - Restored ability to set columns on FieldSet. The FieldSet#columns acts as a hint, which Form uses at render time. Will be part of 1.5M2

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Ben Warner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development