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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]