Hi Axel,
While I wouldn't put a table inside a FieldSet or Form for that matter it
should render.
For some reason the Control is replaced which throws an error. Are you using
stateful pages or have
controls with the same name? In 2.3.0-M1 the replace method have deprecated
along with stateful
pages, so hopefully we can get rid of the replace method in a future release
and throw better error
messages.
Kind regards
Bob
On 20/12/2010 22:16, Axel Morgner wrote:
> Hello,
>
> when adding first a Table and then a PickList to a FieldSet (using 2.3.0-M1)
> I'm getting a
>
> java.lang.ArrayIndexOutOfBoundsException: -1
> at java.util.ArrayList.elementData(ArrayList.java:338)
> at java.util.ArrayList.set(ArrayList.java:366)
> at org.apache.click.control.FieldSet.replace(FieldSet.java:276)
> at org.apache.click.control.FieldSet.insert(FieldSet.java:213)
> at org.apache.click.control.FieldSet.add(FieldSet.java:328)
> at org.apache.click.control.FieldSet.add(FieldSet.java:352)
>
> Adding the PickList first and then the Table doesn't throw an exception, but
> then the PickList will
> not be rendered.
>
> Code is similar to this (of course, in the real code the controls a populated
> with DataProvider etc.):
>
> public class Test extends Page {
>
> protected Table testTable = new Table("Test Table");
> protected PickList testPickList = new PickList("Test Pick List);
>
> public Test() {
>
> super();
>
> FieldSet fields = new FieldSet("test");
> testTable.setClass(Table.CLASS_SIMPLE);
> testTable.addColumn(new Column("Test Column"));
> fields.add(testTable);
> fields.add(testPickList);
>
> [...]
>
> }
>
> [...]
>
> }
>
> Maybe its not supported?
>
> I can work around this, so just a minor issue here.
>
> Axel