Hi Sven,
On 26/07/2010 22:27, Sven Pfeiffer wrote:
>
> I'd like to add a FieldSet to tab in a TabbedForm, my code looks like this:
>
> TabbedForm form = new TabbedForm("form");
> FieldSet protFS = new FieldSet("protocol");
> FieldSet dataSet = new FieldSet("data");
>
> ... adding fields to dataSet
>
> protFS.add(dataSet); // this crashes
> form.addTabSheet(protFS);
>
> The line protFS.add(dataSet) crashes with the following Exception:
> java.lang.IllegalArgumentException: Cannot set the FieldSet's form to null
In your example above you are adding one FieldSet to another FieldSet, not the
TabbedForm.
Regardless it sounds as if dataSet has already been added to another parent?
Are you using
Autobinding or a Stateful page perhaps?
> I also tried setting the form manually:
> dataSet.setForm(form);
>
> Currently I am using click 2.1.0
>
> Is there any way to add a FieldSet to a tab?
TabbedForm is basically a Form with a number of FieldSets that are rendered as
Tabs. But it looks
like you want to add a FieldSet to another FieldSet? It should work though.
Kind regards
Bob