RE: error(validatable)

2009-07-18 Thread Kenneth NA

Thanks for the information.

But if I don't have an Ajax button but a normal Button which submits the form? 

There is no target "variable" in the onValidate() method. 


I attached a quickstart earlier, where I showed that if I use Ajax 
onblur/onchange and use onError/onUpdate there

i nor problem of showing the error but when I the later click the "submit" 
button the error is NOT displayed

when they validator "kicks in". 

 

/Kenneth

 
> From: russellsimpk...@hotmail.com
> To: users@wicket.apache.org
> Subject: RE: error(validatable)
> Date: Sat, 18 Jul 2009 07:47:45 -0400
> 
> 
> Kenneth, 
> I over rode onError when I used the ComponentFeedbackPanel - when learning 
> Wicket, I discovered that I had no idea my form errored out unless I did the 
> following for my form. In this instance, I'm using the AjaxButton. I think 
> the key is to add your feedback component to the target.
> 
> /** * Always, always add this - its much better to know there was an error. * 
> @see 
> org.apache.wicket.ajax.markup.html.form.AjaxButton#onError(org.apache.wicket.ajax.AjaxRequestTarget,
>  org.apache.wicket.markup.html.form.Form) */@Overrideprotected void 
> onError(AjaxRequestTarget target, Form tform) { super.onError(target, tform); 
> form.error("Please make sure you have filled in all required fields."); // 
> add the feedback - seems you have to do this to give feedback on errors. 
> target.addComponent(emailFeedback); }
> 
> > From: rinoc...@live.se
> > To: users@wicket.apache.org
> > Subject: error(validatable)
> > Date: Sat, 18 Jul 2009 12:32:46 +0200
> > 
> > 
> > 
> > 
> > Let's rephrase my problem.
> > 
> > 
> > 
> > I connect a validator to a TextField in a DataView (inside populateItem() 
> > and connect a ComponentFeedbackPanel to it.
> > 
> > 
> > final TextField tf = new TextField("data", new PropertyModel(row, "data"));
> > final ComponentFeedbackPanel tfFeedback = new ComponentFeedbackPanel("fb", 
> > tf);
> > tfFeedback.setOutputMarkupId(true);
> > item.add(tf);
> > item.add(tfFeedback);
> > 
> > And I also have both in the HTML markup
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Is this enough for the error reported in in onValidate() for the validator 
> > connected to the field 
> > 
> > with error(ivalidatable); should be displayed next to the field or does it 
> > require something more?
> > 
> > 
> > 
> > error(validatable, "an_error_occured");
> > 
> > 
> > Why I wonder is that it is not displayed next to the field, it is displayed 
> > in the "common" feedback panel.
> > 
> > 
> > 
> > /Kenneth
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > _
> > Med Windows Live kan du ordna, redigera och dela med dig av dina foton.
> > http://www.microsoft.com/sverige/windows/windowslive/products/photo-gallery-edit.aspx
> 
> _
> Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
> http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

_
Med Windows Live kan du ordna, redigera och dela med dig av dina foton.
http://www.microsoft.com/sverige/windows/windowslive/products/photo-gallery-edit.aspx

error(validatable)

2009-07-18 Thread Kenneth NA

 

Let's rephrase my problem.

 

I connect a validator to a TextField in a DataView (inside populateItem() and 
connect a ComponentFeedbackPanel  to it.


final TextField tf = new TextField("data", new 
PropertyModel(row, "data"));
final ComponentFeedbackPanel tfFeedback = new 
ComponentFeedbackPanel("fb", tf);
tfFeedback.setOutputMarkupId(true);
item.add(tf);
item.add(tfFeedback);

And I also have both in the HTML markup







Is this enough for the error reported in in onValidate() for the validator 
connected to the field 

with error(ivalidatable); should be displayed next to the field or does it 
require something more?

 

error(validatable, "an_error_occured");


Why I wonder is that it is not displayed next to the field, it is displayed in 
the "common" feedback panel.

 

/Kenneth

 

 

 

 

_
Med Windows Live kan du ordna, redigera och dela med dig av dina foton.
http://www.microsoft.com/sverige/windows/windowslive/products/photo-gallery-edit.aspx

RE: Validation component feedback in table column

2009-07-17 Thread Kenneth NA

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: russellsimpk...@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:
> 
> 
> From: rinoc...@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: jer...@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

Is it possible to register multiple behaviors for a field?

2009-07-12 Thread Kenneth NA

 
I want to register two behaviors for a textfield, is this possible, as I only 
see the result and call to one of them? 


This is what I am trying to do: 
textfield.add(new ComponentVisualErrorBehavior("onblur", tf));
textfield.add(new AjaxFormComponentUpdatingBehavior("onblur") { ... }



_
Vårkänslor och pirr i magen? Hitta din drömpartner här!
http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952

Validation and component feedback for editable column component in table/list

2009-07-11 Thread Kenneth NA

 

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