You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lurtz Nazgul <lu...@ymail.com> on 2011/08/25 08:43:07 UTC

FeedbackPanel rendering

Hi all; 


I have two panels. 


Panel one have the standart form with one Label + TextField (required field) + AjaxButton.

Panel two have one FeedbackPanel. 


Ok, here is the the problem : 


I can reach Panel Two' FeedbackPanel from Panel One. 


So in AjaxButton 


   AjaxButton submit = new AjaxButton("submit") {
                @Override
                protected void onError(AjaxRequestTarget target, Form<?> form) {
                    FeedbackPanel feedbackPanel = getFeedbackPanel(); // gets FeedBackPanel from Panel Two
                    target.addComponent(feedbackPanel); // it renders, no problem
                    target.addComponent(form);
                }

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                    FeedbackPanel feedbackPanel = getFeedbackPanel(); // gets FeedBackPanel from Panel Two
                   info("Saved"); // just an info message
                    target.addComponent(form);
                    target.addComponent(feedbackPanel); // no way
                  
                }
            };
When Validation error occurs (onError)  Panel's two FeedbackPanel renders and shows the error. Great ! 


But when there is no error (onSubmit)Panel's two FeedbackPanel doesn't render and it gives 


component-targetted feedback message was left unrendered. This could be because you are missing a FeedbackPanel on the page.  Message: [FeedbackMessage message = "Saved", reporter = go, level = INFO]


Any suggestions ?

Regards.

Re: FeedbackPanel rendering

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
I've made a quickstart project trying to reproduce your code, but I 
didn't get your problem.
The project is based on 1.4.18 and has just one homepage.

Markup code:

<html 
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" 
 >
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>

<div wicket:id="panel1">
<form wicket:id="form">
<button wicket:id="subBut"></button>
</form>
</div>

<div wicket:id="panel2">
<span wicket:id="feedBack"></span>
</div>
</body>
</html>



Java code:


public class HomePage extends WebPage {

     private static final long serialVersionUID = 1L;
     private FeedbackPanel feedbackPanel;

     public HomePage(final PageParameters parameters) {
         WebMarkupContainer panel1 = new WebMarkupContainer("panel1");
     WebMarkupContainer panel2 = new WebMarkupContainer("panel2");

     Form form = new Form("form");
     form.setOutputMarkupId(true);

     AjaxButton subBut = new AjaxButton("subBut") {
                 @Override
                 protected void onError(AjaxRequestTarget target, 
Form<?> form) {
                     target.addComponent(feedbackPanel); // it renders, 
no problem
                     target.addComponent(form);
                 }

                 @Override
                 protected void onSubmit(AjaxRequestTarget target, 
Form<?> form) {
                     info("Saved"); // just an info message
                     target.addComponent(form);
                     target.addComponent(feedbackPanel); // no way

                 }
         };

     panel1.add(form);
     form.add(subBut);

     panel2.add(feedbackPanel = new FeedbackPanel("feedBack"));
     feedbackPanel.setOutputMarkupId(true);
     add(panel1);
     add(panel2);
     }
}

> Hi Andre; Thanks for your answer.
>
>
> I didn't override form's onSubmit method.
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel rendering

Posted by Lurtz Nazgul <lu...@ymail.com>.
Hi Andre; Thanks for your answer. 


I didn't override form's onSubmit method.



________________________________
From: Andrea Del Bene <ad...@ciseonweb.it>
To: users@wicket.apache.org
Sent: Thursday, August 25, 2011 11:42 AM
Subject: Re: FeedbackPanel rendering

Hi Lurtz,

what does your form do in its onSubmit method? Have you overriden it?
> Hi all;
>
>
> I have two panels.
>
>
> Panel one have the standart form with one Label + TextField (required field) + AjaxButton.
>
> Panel two have one FeedbackPanel.
>
>
> Ok, here is the the problem :
>
>
> I can reach Panel Two' FeedbackPanel from Panel One.
>
>
> So in AjaxButton
>
>
>     AjaxButton submit = new AjaxButton("submit") {
>                  @Override
>                  protected void onError(AjaxRequestTarget target, Form<?>  form) {
>                      FeedbackPanel feedbackPanel = getFeedbackPanel(); // gets FeedBackPanel from Panel Two
>                      target.addComponent(feedbackPanel); // it renders, no problem
>                      target.addComponent(form);
>                  }
>
>                  @Override
>                  protected void onSubmit(AjaxRequestTarget target, Form<?>  form) {
>                      FeedbackPanel feedbackPanel = getFeedbackPanel(); // gets FeedBackPanel from Panel Two
>                     info("Saved"); // just an info message
>                      target.addComponent(form);
>                      target.addComponent(feedbackPanel); // no way
>                  
>                  }
>              };
> When Validation error occurs (onError)  Panel's two FeedbackPanel renders and shows the error. Great !
>
>
> But when there is no error (onSubmit)Panel's two FeedbackPanel doesn't render and it gives
>
>
> component-targetted feedback message was left unrendered. This could be because you are missing a FeedbackPanel on the page.  Message: [FeedbackMessage message = "Saved", reporter = go, level = INFO]
>
>
> Any suggestions ?
>
> Regards.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org

Re: FeedbackPanel rendering

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Hi Lurtz,

what does your form do in its onSubmit method? Have you overriden it?
> Hi all;
>
>
> I have two panels.
>
>
> Panel one have the standart form with one Label + TextField (required field) + AjaxButton.
>
> Panel two have one FeedbackPanel.
>
>
> Ok, here is the the problem :
>
>
> I can reach Panel Two' FeedbackPanel from Panel One.
>
>
> So in AjaxButton
>
>
>     AjaxButton submit = new AjaxButton("submit") {
>                  @Override
>                  protected void onError(AjaxRequestTarget target, Form<?>  form) {
>                      FeedbackPanel feedbackPanel = getFeedbackPanel(); // gets FeedBackPanel from Panel Two
>                      target.addComponent(feedbackPanel); // it renders, no problem
>                      target.addComponent(form);
>                  }
>
>                  @Override
>                  protected void onSubmit(AjaxRequestTarget target, Form<?>  form) {
>                      FeedbackPanel feedbackPanel = getFeedbackPanel(); // gets FeedBackPanel from Panel Two
>                     info("Saved"); // just an info message
>                      target.addComponent(form);
>                      target.addComponent(feedbackPanel); // no way
>                   
>                  }
>              };
> When Validation error occurs (onError)  Panel's two FeedbackPanel renders and shows the error. Great !
>
>
> But when there is no error (onSubmit)Panel's two FeedbackPanel doesn't render and it gives
>
>
> component-targetted feedback message was left unrendered. This could be because you are missing a FeedbackPanel on the page.  Message: [FeedbackMessage message = "Saved", reporter = go, level = INFO]
>
>
> Any suggestions ?
>
> Regards.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org