I have already added one ComponentFeedbackPanel in the populateItem() method
final ComponentFeedbackPanel tfFeedback = new
ComponentFeedbackPanel("tfFeedback", tf);
tfFeedback.setOutputMarkupId(true);
item.add(tfFeedback);
and if I also add the suggested code in the validator in method
onValidate(IValidatable validatable) when the validation fails, I get the
following error:
WicketMessage: The component(s) below failed to render. A common problem is
that you have added a component in code but forgot to reference it in the
markup (thus the component will never be rendered).
1. [MarkupContainer [Component id = tfFeedback]]
2. [MarkupContainer [Component id = feedbackul]]
3. [MarkupContainer [Component id = messages]]
4. [MarkupContainer [Component id = 0]]
5. [Component id = message]
...
So, I still wonder, have can I solve this problem?
/Kenneth
> From: [email protected]
> To: [email protected]
> Subject: RE: Validation component feedback in table column
> Date: Fri, 17 Jul 2009 06:03:35 -0400
>
>
> Use the ComponentFeedbackPanel,
> ccFeedback = new ComponentFeedbackPanel("ccNumberError",ccNumber);
> ccFeedback.setOutputMarkupId(true);
> addOrReplace(ccFeedback);then you can do this:
> <input wicket:id="ccNumber" value="" type="text" />
> <span wicket:id="ccNumberError"></span>
> From: [email protected]
> To: [email protected]
> Subject: Validation component feedback in table column
> Date: Fri, 17 Jul 2009 10:34:19 +0200
>
>
>
>
>
>
>
>
> I have been experimenting with this for while more, but I can't seem to get
> it to work as I want.
>
> I have attached a small quickstart.
>
> I have a table with an input field on each row, where I want to validate that
> the entered input value should not be allowed to be more than the displayed
> value, in that case, a message should be displayed next to the field, in the
> table.
>
> I have added an onblur event to the input field and also a validator.
>
> If I enter a value above the limit and tab out of the field, the validation
> message is displayed next to the field. If I instead enter a errornous value
> an click the submit button, the error message(s) is displayed in the form
> feeback and not next to the field. How do I get the validation error to be
> displayed next to the field?
>
>
>
> I have been reading alot of examples, javadoc and source now and can't get it
> to work the wy I want.
> I wonder how I change my code to get it to work?
>
>
>
> /Kenneth
>
> > Date: Sat, 11 Jul 2009 22:09:32 -0500
> > Subject: Re: Validation and component feedback for editable column
> > component in table/list
> > From: [email protected]
> > To: [email protected]
> >
> > Seems like you might be missing the part where you have to add a
> > feedback panel to display the error messages in a form. Since you
> > mention that your previous application showed the message near the
> > field, this page might help you:
> >
> > http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
>
> Gör personlighetstestet på MSN Dejting, se vem du passar ihop med! MSN Dejting
> _________________________________________________________________
> Windows Live™ SkyDrive™: Get 25 GB of free online storage.
> http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009
_________________________________________________________________
Hitta kärleken nu i vår!
http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952