You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kenneth NA <ri...@live.se> on 2009/07/11 20:00:01 UTC
Validation and component feedback for editable column component in
table/list
I am a new user of wicket and I have been experimenting the last days.
I am trying to migrate an existing JSP applikation to wicket.
I now have a problem with feedback and validation error display.
In the existing applikation, the validation errors are display next to the fields,
by displaying a little error icon with the error message as a tooltip
and at the same time the form component change style, i.e. testfields
gets a red border.
One of the pages I am experimenting with, have a list where
all columns are static, like dates, numbers and amounts except one
where an (intiallly empty) editable amount field is displayed.
It is this field I have problem of getting to work to display errors for.
The validation on each row should compare the entered amount, that it is not
hígher than, one of the other amounts in the "row" model.
The sum of the entered amounts in all rows are also not allowed to be
higher than another amount in a form component outisde the datatable.
I have attached AjaxFormComponentUpdatingBehavior with onblur which calls error(),
but I just get the following warning all the time:
VARNING: Component-targetted feedback message was left unrendered.
I have tried adding the table in aWebMarkupContainer, I have called setOutputMarkupId(true),
I have called target.addCmponent(wmc).
I have also tried with FormComponentFeedbackIndicator but without success.
I have been looking around the examples and a lot of web pages and now
I decided that maybe someone can point me in the direction
where someone have an example on just this.
Even a small initial example would be appreciated.
Thanks, Kenneth
_________________________________________________________________
Vi vet vem du passar ihop med! Klicka här för att få veta!
http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952
RE: Validation component feedback in table column
Posted by Kenneth NA <ri...@live.se>.
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: russellsimpkins@hotmail.com
> To: users@wicket.apache.org
> 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: rinocent@live.se
> To: users@wicket.apache.org
> 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: jeremy@wickettraining.com
> > To: users@wicket.apache.org
> >
> > 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
RE: Validation component feedback in table column
Posted by Russell Simpkins <ru...@hotmail.com>.
Use the ComponentFeedbackPanel,
ccFeedback = new ComponentFeedbackPanel("ccNumberError",ccNumber);
ccFeedback.setOutputMarkupId(true);
addOrReplace(ccFeedback);then you can do this:
<input wicket:id="ccNumber" value="" class="" type="text" />
<span wicket:id="ccNumberError"></span>
From: rinocent@live.se
To: users@wicket.apache.org
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: jeremy@wickettraining.com
> To: users@wicket.apache.org
>
> 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
Validation component feedback in table column
Posted by Kenneth NA <ri...@live.se>.
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: jeremy@wickettraining.com
> To: users@wicket.apache.org
>
> 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
>
>
>
_________________________________________________________________
Vem �r du? G�r personlighetstestet p� MSN Dejting!
http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952
Re: Validation and component feedback for editable column component
in table/list
Posted by Jeremy Thomerson <je...@wickettraining.com>.
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
On Sat, Jul 11, 2009 at 1:00 PM, Kenneth NA<ri...@live.se> wrote:
>
>
>
> I am a new user of wicket and I have been experimenting the last days.
>
> I am trying to migrate an existing JSP applikation to wicket.
>
>
>
> I now have a problem with feedback and validation error display.
>
>
>
> In the existing applikation, the validation errors are display next to the fields,
>
> by displaying a little error icon with the error message as a tooltip
>
> and at the same time the form component change style, i.e. testfields
>
> gets a red border.
>
>
>
> One of the pages I am experimenting with, have a list where
>
> all columns are static, like dates, numbers and amounts except one
>
> where an (intiallly empty) editable amount field is displayed.
>
> It is this field I have problem of getting to work to display errors for.
>
>
>
> The validation on each row should compare the entered amount, that it is not
>
> hígher than, one of the other amounts in the "row" model.
>
> The sum of the entered amounts in all rows are also not allowed to be
>
> higher than another amount in a form component outisde the datatable.
>
>
>
> I have attached AjaxFormComponentUpdatingBehavior with onblur which calls error(),
>
> but I just get the following warning all the time:
>
> VARNING: Component-targetted feedback message was left unrendered.
>
>
>
> I have tried adding the table in aWebMarkupContainer, I have called setOutputMarkupId(true),
>
> I have called target.addCmponent(wmc).
>
> I have also tried with FormComponentFeedbackIndicator but without success.
>
>
>
> I have been looking around the examples and a lot of web pages and now
>
> I decided that maybe someone can point me in the direction
>
> where someone have an example on just this.
>
>
>
> Even a small initial example would be appreciated.
>
>
>
> Thanks, Kenneth
>
>
>
>
>
>
>
> _________________________________________________________________
> Vi vet vem du passar ihop med! Klicka här för att få veta!
> http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org