Click Framework  History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: CLK-379
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Bob Schellink
Reporter: Ben Warner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Click

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

Created: 04/Jun/08 01:24 PM   Updated: 03/Jul/08 09:48 PM
Component/s: core
Affects Version/s: 1.5 M2
Fix Version/s: 1.5 M2


 Description  « Hide
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.


 All   Comments   Change History      Sort Order:
Bob Schellink [06/Jun/08 05:56 AM]
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?

Malcolm Edgar [06/Jun/08 08:25 AM]
I think we need to get the old behaviour working in Form as we need to support existing applications.

regards Malcolm

Bob Schellink [06/Jun/08 08:44 AM]
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.

Malcolm Edgar [06/Jun/08 04:01 PM]
Yes that would be good. You can assign this issue to me if you are busy Bob.

regards Malcolm Edgar

Bob Schellink [06/Jun/08 05:41 PM]
Its already assigned to you ;-)

Bob Schellink [03/Jul/08 09:48 PM]
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