You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marieke Vandamme <ma...@tvh.com> on 2017/07/03 12:46:25 UTC
StatelessForm with CheckGroup
Hi,
I'm using Apache Wicket 7.7.0.
Using following (summarized) code works:
Form form = new Form("form");
CheckGroup group = new CheckGroup("group");
group.add(new ListView("list"){
populateItem(ListItem li){
li.add(new CheckBox("chk"));
}
}.setReuseItems(true));
But when I change the Form to a StatelessForm,
I get the following exception:
org.apache.wicket.WicketRuntimeException: submitted http post value
[check0] for CheckGroup component [form:group] contains an illegal value
[check0] which does not point to a Check component. Due to this the
CheckGroup component cannot resolve the selected Check component pointed to
by the illegal value. A possible reason is that component hierarchy changed
between rendering and form submission.
Thanks ! Kind Regards, Marieke
--
**** DISCLAIMER ****
http://www.tvh.com/glob/en/email-disclaimer
"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."
Re: StatelessForm with CheckGroup
Posted by Sven Meier <sv...@meiers.net>.
Hi,
please see AbstractRepeater's javadoc:
"the children are added during the render phase (in {@linkplain
#beforeRender()} so
most of the specializations of this class should not be used as parents of
{@link org.apache.wicket.markup.html.form.FormComponent}s in stateless
pages because the form components
will not be available during the action phase (i.e. at
{@link org.apache.wicket.markup.html.form.StatelessForm#onSubmit()}). Use
{@link org.apache.wicket.markup.repeater.RepeatingView} in these cases."
Hope this helps
Sven
Am 03.07.2017 um 14:46 schrieb Marieke Vandamme:
> Hi,
>
> I'm using Apache Wicket 7.7.0.
> Using following (summarized) code works:
> Form form = new Form("form");
> CheckGroup group = new CheckGroup("group");
> group.add(new ListView("list"){
> populateItem(ListItem li){
> li.add(new CheckBox("chk"));
> }
> }.setReuseItems(true));
>
> But when I change the Form to a StatelessForm,
> I get the following exception:
> org.apache.wicket.WicketRuntimeException: submitted http post value
> [check0] for CheckGroup component [form:group] contains an illegal value
> [check0] which does not point to a Check component. Due to this the
> CheckGroup component cannot resolve the selected Check component pointed to
> by the illegal value. A possible reason is that component hierarchy changed
> between rendering and form submission.
>
> Thanks ! Kind Regards, Marieke
>