click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject [Fwd: [Click-development] Click JIRA - Commented: (CLK-447) Investigate Form #insert logic]
Date Tue, 14 Oct 2008 05:58:10 GMT
Hi Malcolm,

Yes, Form insert logic breaks because of line 2248:
renderControls(buffer, this, getControls(), getFieldWidths(), getColumns());

It uses getControls instead of getFieldList.

There are a couple of issues with insert on Form:

#1 Changing the line to use getFieldList means that the non-field 
controls won't render. Thus wrapping a Field in a Div or Span for 
example won't work
#2 The insert logic is quite complex because of the need to manage the 
index for buttonList and fieldList.
#3 There is duplicate insertion logic in AbstractContainer, Form and 

Looking at this yesterday I am thinking about removing the Form insert 
logic and let it behave the same as AbstractContainer e.g.
the insert is done on the controlList.

The last issue I've identified is that fieldList and buttonList will 
only return fields and buttons which are added directly to them.
Adding a field as follows won't work:

Form form = new Form("form");
PlaceHolderDiv div = new PlaceHolderDiv();
div.add(new Select("name"));

HtmlForm works slightly different here by recursively including fields:

public List getFieldList() {
    return ContainerUtils.getFieldsAndLabels(this);

Perhaps we should change Form to use this logic as well?

Alternatively Form should not be allowed to add any other control except 

What do you think?

kind regards


-------- Original Message --------
Subject: 	[Click-development] Click JIRA - Commented: (CLK-447) 
Investigate Form #insert logic
Date: 	Tue, 14 Oct 2008 13:21:12 +1000 (EST)
From: 	Malcolm Edgar (JIRA) <>

    [ ] 
Malcolm Edgar commented on CLK-447:

The insert logic is not appear to be working now, after testing. It is putting field at the
end of the form rather than in their indexed position.

> Investigate Form #insert logic
> ------------------------------
>                 Key: CLK-447
>                 URL:
>             Project: Click
>          Issue Type: Bug
>    Affects Versions: 1.5 RC2
>            Reporter: Bob Schellink
>         Assigned To: Bob Schellink
>             Fix For: 1.5
> Not sure if the current Form#insert logic is quite correct. We need to take a look at
this before 1.5 final is released.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Click-development mailing list

View raw message