You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jason Wang <ja...@bulletin.net> on 2009/04/27 01:52:40 UTC

Does FeedbackPanel have to be added to Page?

Hi all,


I got a weird error when doing a form component validation. When it 
fails on the validation the feedback panel is not updated with the error 
message. The log shows this:

 Component-targetted feedback message was left unrendered. This could be 
because you are missing a FeedbackPanel on the page.


Well, I added the FeedbackPanel on the form belonging to a webpage. And 
all the error messages sent to the panel can be properly displayed. Just 
the one triggered with a component.validate failed to display.

The example below can reproduce this error I got:
Java:

public class Example extends WebPage {
    public Example(){
        Form signupForm = new Form("signUpForm");
        final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");
        feedbackPanel.setEscapeModelStrings(false).setOutputMarkupId(true);
        signupForm.add(feedbackPanel);

        final RequiredTextField<String> mobile = new 
RequiredTextField<String>(
                "mobile");
        mobile.setLabel(new Model<String>("mobile")).add(new 
PatternValidator("^[1-9]([0-9]{8,14})"));

        mobile.add(new AjaxFormComponentUpdatingBehavior("onblur") {
            protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
                mobile.validate();
                ajaxRequestTarget.addComponent(feedbackPanel);
            }
        });
        signupForm.add(mobile);

        add(signupForm);
    }
}

Html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:wicket="http://wicket.sourceforge.net/"
        xml:lang="en"
        lang="en">
<body>



        <form wicket:id="signUpForm" class="signUpForm">
            <span wicket:id="feedback">[feedbackmessages will be put 
here]</span>
            <input wicket:id="mobile" id="mobile" type="text" size="20" 
class="signUpForm-input"/>
           
        </form>

</body>
</html>





Cheers,
Jason

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


Re: Does FeedbackPanel have to be added to Page?

Posted by Jason Wang <ja...@bulletin.net>.
Igor Vaynberg wrote:
> mobile.add(new AjaxFormComponentUpdatingBehavior("onblur") {
>           protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
>               mobile.validate();
>               ajaxRequestTarget.addComponent(feedbackPanel);
>           }
> ===> protected void onError(target) { target.addcomponent(feedbackpanel);}
>       });
>
> -igor
>
> On Sun, Apr 26, 2009 at 4:52 PM, Jason Wang <ja...@bulletin.net> wrote:
>   
>> Hi all,
>>
>>
>> I got a weird error when doing a form component validation. When it fails on
>> the validation the feedback panel is not updated with the error message. The
>> log shows this:
>>
>> Component-targetted feedback message was left unrendered. This could be
>> because you are missing a FeedbackPanel on the page.
>>
>>
>> Well, I added the FeedbackPanel on the form belonging to a webpage. And all
>> the error messages sent to the panel can be properly displayed. Just the one
>> triggered with a component.validate failed to display.
>>
>> The example below can reproduce this error I got:
>> Java:
>>
>> public class Example extends WebPage {
>>   public Example(){
>>       Form signupForm = new Form("signUpForm");
>>       final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");
>>       feedbackPanel.setEscapeModelStrings(false).setOutputMarkupId(true);
>>       signupForm.add(feedbackPanel);
>>
>>       final RequiredTextField<String> mobile = new
>> RequiredTextField<String>(
>>               "mobile");
>>       mobile.setLabel(new Model<String>("mobile")).add(new
>> PatternValidator("^[1-9]([0-9]{8,14})"));
>>
>>       mobile.add(new AjaxFormComponentUpdatingBehavior("onblur") {
>>           protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
>>               mobile.validate();
>>               ajaxRequestTarget.addComponent(feedbackPanel);
>>           }
>>       });
>>       signupForm.add(mobile);
>>
>>       add(signupForm);
>>   }
>> }
>>
>> Html:
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>
>> <html
>>       xmlns="http://www.w3.org/1999/xhtml"
>>       xmlns:wicket="http://wicket.sourceforge.net/"
>>       xml:lang="en"
>>       lang="en">
>> <body>
>>
>>
>>
>>       <form wicket:id="signUpForm" class="signUpForm">
>>           <span wicket:id="feedback">[feedbackmessages will be put
>> here]</span>
>>           <input wicket:id="mobile" id="mobile" type="text" size="20"
>> class="signUpForm-input"/>
>>                 </form>
>>
>> </body>
>> </html>
>>
>>
>>
>>
>>
>> Cheers,
>> Jason
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   
Thanks. That works fine.


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


Re: Does FeedbackPanel have to be added to Page?

Posted by Igor Vaynberg <ig...@gmail.com>.
mobile.add(new AjaxFormComponentUpdatingBehavior("onblur") {
          protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
              mobile.validate();
              ajaxRequestTarget.addComponent(feedbackPanel);
          }
===> protected void onError(target) { target.addcomponent(feedbackpanel);}
      });

-igor

On Sun, Apr 26, 2009 at 4:52 PM, Jason Wang <ja...@bulletin.net> wrote:
> Hi all,
>
>
> I got a weird error when doing a form component validation. When it fails on
> the validation the feedback panel is not updated with the error message. The
> log shows this:
>
> Component-targetted feedback message was left unrendered. This could be
> because you are missing a FeedbackPanel on the page.
>
>
> Well, I added the FeedbackPanel on the form belonging to a webpage. And all
> the error messages sent to the panel can be properly displayed. Just the one
> triggered with a component.validate failed to display.
>
> The example below can reproduce this error I got:
> Java:
>
> public class Example extends WebPage {
>   public Example(){
>       Form signupForm = new Form("signUpForm");
>       final FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");
>       feedbackPanel.setEscapeModelStrings(false).setOutputMarkupId(true);
>       signupForm.add(feedbackPanel);
>
>       final RequiredTextField<String> mobile = new
> RequiredTextField<String>(
>               "mobile");
>       mobile.setLabel(new Model<String>("mobile")).add(new
> PatternValidator("^[1-9]([0-9]{8,14})"));
>
>       mobile.add(new AjaxFormComponentUpdatingBehavior("onblur") {
>           protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
>               mobile.validate();
>               ajaxRequestTarget.addComponent(feedbackPanel);
>           }
>       });
>       signupForm.add(mobile);
>
>       add(signupForm);
>   }
> }
>
> Html:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html
>       xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:wicket="http://wicket.sourceforge.net/"
>       xml:lang="en"
>       lang="en">
> <body>
>
>
>
>       <form wicket:id="signUpForm" class="signUpForm">
>           <span wicket:id="feedback">[feedbackmessages will be put
> here]</span>
>           <input wicket:id="mobile" id="mobile" type="text" size="20"
> class="signUpForm-input"/>
>                 </form>
>
> </body>
> </html>
>
>
>
>
>
> Cheers,
> Jason
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Does FeedbackPanel have to be added to Page?

Posted by Brill Pappin <br...@pappin.ca>.
That error comes directly from this ticket in JIRA... if you want to  
know how it came to be, read the comments.

https://issues.apache.org/jira/browse/WICKET-1138

- Brill Pappin





On 26-Apr-09, at 7:52 PM, Jason Wang wrote:

> Hi all,
>
>
> I got a weird error when doing a form component validation. When it  
> fails on the validation the feedback panel is not updated with the  
> error message. The log shows this:
>
> Component-targetted feedback message was left unrendered. This could  
> be because you are missing a FeedbackPanel on the page.
>
>
> Well, I added the FeedbackPanel on the form belonging to a webpage.  
> And all the error messages sent to the panel can be properly  
> displayed. Just the one triggered with a component.validate failed  
> to display.
>
> The example below can reproduce this error I got:
> Java:
>
> public class Example extends WebPage {
>   public Example(){
>       Form signupForm = new Form("signUpForm");
>       final FeedbackPanel feedbackPanel = new  
> FeedbackPanel("feedback");
>        
> feedbackPanel.setEscapeModelStrings(false).setOutputMarkupId(true);
>       signupForm.add(feedbackPanel);
>
>       final RequiredTextField<String> mobile = new  
> RequiredTextField<String>(
>               "mobile");
>       mobile.setLabel(new Model<String>("mobile")).add(new  
> PatternValidator("^[1-9]([0-9]{8,14})"));
>
>       mobile.add(new AjaxFormComponentUpdatingBehavior("onblur") {
>           protected void onUpdate(AjaxRequestTarget  
> ajaxRequestTarget) {
>               mobile.validate();
>               ajaxRequestTarget.addComponent(feedbackPanel);
>           }
>       });
>       signupForm.add(mobile);
>
>       add(signupForm);
>   }
> }
>
> Html:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html
>       xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:wicket="http://wicket.sourceforge.net/"
>       xml:lang="en"
>       lang="en">
> <body>
>
>
>
>       <form wicket:id="signUpForm" class="signUpForm">
>           <span wicket:id="feedback">[feedbackmessages will be put  
> here]</span>
>           <input wicket:id="mobile" id="mobile" type="text"  
> size="20" class="signUpForm-input"/>
>                 </form>
>
> </body>
> </html>
>
>
>
>
>
> Cheers,
> Jason
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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