You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Casper Kent <ca...@gmail.com> on 2019/02/19 09:36:26 UTC

FeedbackPanel not clear

I am trying to implement a "Clear" button on a form that will clear the
input fields as well as any feedback messages.  The fields are clear with
form.clearInput() but the feedback messages are not.  This is done with a
AjaxButton.  I thought when the feedback panel is added to the target, it
will make the messages disappeared but it does not.  Here is the relevant
code:

       form.add(new AjaxButton("clearButton") {
                @Override
                protected void onSubmit(AjaxRequestTarget target) {
                    form.clearInput();
                    target.add(form);
                    target.add(feedback);
                }
                @Override
                protected void onError(AjaxRequestTarget target) {
                    form.clearInput();
                    target.add(form);
                    target.add(feedback);
                }
            });

Re: FeedbackPanel not clear

Posted by Casper Kent <ca...@gmail.com>.
Yes that does it, thank you very much.

On Tue, Feb 19, 2019 at 2:09 AM sven <sv...@meiers.net> wrote:

>
>
> Have you tried #setDefaultFormProcessing(false)?
>
>
>
> Otherwise the button will trigger new validation errors.
>
>
>
> Sven
>
>
>
>
>
>
>
>
>
> >
> > On 19.02.2019 at 10:36,  <Casper Kent>  wrote:
> >
> >
> >  I am trying to implement a "Clear" button on a form that will clear the
> input fields as well as any feedback messages. The fields are clear with
> form.clearInput() but the feedback messages are not. This is done with a
> AjaxButton. I thought when the feedback panel is added to the target, it
> will make the messages disappeared but it does not. Here is the relevant
> code: form.add(new AjaxButton("clearButton") { @Override protected void
> onSubmit(AjaxRequestTarget target) { form.clearInput(); target.add(form);
> target.add(feedback); } @Override protected void onError(AjaxRequestTarget
> target) { form.clearInput(); target.add(form); target.add(feedback); } });
> >
>

Re: FeedbackPanel not clear

Posted by Martin Grigorov <mg...@apache.org>.
Or even use AjaxLink instead.

On Tue, Feb 19, 2019 at 12:09 PM sven <sv...@meiers.net> wrote:

>
>
> Have you tried #setDefaultFormProcessing(false)?
>
>
>
> Otherwise the button will trigger new validation errors.
>
>
>
> Sven
>
>
>
>
>
>
>
>
>
> >
> > On 19.02.2019 at 10:36,  <Casper Kent>  wrote:
> >
> >
> >  I am trying to implement a "Clear" button on a form that will clear the
> input fields as well as any feedback messages. The fields are clear with
> form.clearInput() but the feedback messages are not. This is done with a
> AjaxButton. I thought when the feedback panel is added to the target, it
> will make the messages disappeared but it does not. Here is the relevant
> code: form.add(new AjaxButton("clearButton") { @Override protected void
> onSubmit(AjaxRequestTarget target) { form.clearInput(); target.add(form);
> target.add(feedback); } @Override protected void onError(AjaxRequestTarget
> target) { form.clearInput(); target.add(form); target.add(feedback); } });
> >
>

Re: FeedbackPanel not clear

Posted by sven <sv...@meiers.net>.
 
 
Have you tried #setDefaultFormProcessing(false)?
 

 
Otherwise the button will trigger new validation errors.
 

 
Sven
 
 
 

 
 
 
 
 
>  
> On 19.02.2019 at 10:36,  <Casper Kent>  wrote:
>  
>  
>  I am trying to implement a "Clear" button on a form that will clear the input fields as well as any feedback messages. The fields are clear with form.clearInput() but the feedback messages are not. This is done with a AjaxButton. I thought when the feedback panel is added to the target, it will make the messages disappeared but it does not. Here is the relevant code: form.add(new AjaxButton("clearButton") { @Override protected void onSubmit(AjaxRequestTarget target) { form.clearInput(); target.add(form); target.add(feedback); } @Override protected void onError(AjaxRequestTarget target) { form.clearInput(); target.add(form); target.add(feedback); } }); 
>