You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by Bob Schellink <sa...@gmail.com> on 2008/10/14 07:58:10 UTC

[Fwd: [Click-development] Click JIRA - Commented: (CLK-447) Investigate Form #insert logic]

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 
HtmlForm.

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"));
form.add(div);

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 
Fields.

What do you think?

kind regards

bob


-------- 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) <cl...@avoka.com>
To: 	click-development@lists.sourceforge.net



    [ http://www.avoka.com:8080/jira/browse/CLK-447?page=comments#action_11537 ] 
            
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: http://www.avoka.com:8080/jira/browse/CLK-447
>             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: http://www.avoka.com:8080/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
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
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-development mailing list
Click-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/click-development