Hi guys!

I'm trying create a label contain an error message after ajax request, but
no success. I can't use FeedbackPanel because it changes the design.
So I did:

final Label label = new Label("postalCodeNotExisti");
label.setOutputMarkupId(true);

final RequiredTextField postalCodeComplement = (RequiredTextField) new
RequiredTextField("individualAddresses.postalCodeComplement",
    new PropertyModel(postalCode, "postalCodeComplement"))
    .add(StringValidator.exactLength(3))
    .add(new AjaxFormComponentUpdatingBehavior("onblur") {

   @Override
   protected void onUpdate(AjaxRequestTarget target) {
       RequestCycle requestCycle = RequestCycle.get();
       String postalCode =
requestCycle.getRequest().getParameter("postalCode");
       target.addComponent(getFormComponent());
       target.addComponent(label);
   }
}).setOutputMarkupId(true);

add(postalCodeComplement);


Not happens! No errors and no label!
Why?

Thanks!

Reply via email to