Re: [Wicket-user] Components Label for FeedbackMessage

2006-05-07 Thread Bruno Borges
Wow, great Igor.Thanks. On 5/7/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:



Wouldn't be better display only one message saying: "Dude, please fill all required fields!"

ok, i just made available boolean FormComponent.checkRequired()this will return false if the component's validation of required check failed. this lets you filter out all the pesky required messages from the feedbackpanel
-Igor

-- Bruno Borges[EMAIL PROTECTED]Sun Certified Java Programmer for 1.4Sun Certified Web Component Developer for 
1.4


Re: [Wicket-user] Components Label for FeedbackMessage

2006-05-07 Thread Igor Vaynberg


Wouldn't be better display only one message saying: "Dude, please fill all required fields!"
ok, i just made available boolean FormComponent.checkRequired()this will return false if the component's validation of required check failed. this lets you filter out all the pesky required messages from the feedbackpanel
-Igor


Re: [Wicket-user] Components Label for FeedbackMessage

2006-05-07 Thread Igor Vaynberg

you can call FormComponent.setLabel(IModel label) on the form components and then use ${label} var in the validator messages.
The problem here is that I already have 
in my html, and all my messages are in html. I'm using i18n directly there. (Page_en.html, Page_br.html, etc...).
Isn't a better way to do this?what happens if your formcomponent is in a repeater? id must be unique across the entire page so if you set it yourself in markup you are in trouble since it will be the same for every row in a repeater.
what we have right now, and what works inside repeaters, etc (also ajax will override any id you have set until 1.3/2.0 is out) is this:TextField tf=new TextField("tf", model).setLabel(new ResourceModel("
resource.key"));add(tf);add(new SimpleFormLabel("label", tf));label goes here
this will create the for and id props and link them with the a unique value. i know this doesnt exactly align with your usecase but this is as close as i can think to get you to what you are after.
If I look for 'required' in the message, how about i18n? :Di didnt say it was perfect 
And yes, the usecase is kind of common. i didnt say it wasnt, just not what the feedbackpanel was designed for.
Wouldn't be better display only one message saying: "Dude, please fill all required fields!"how is the user going to know which fields are required? sure you can have markers etc, but...
if i have a huge form like that i use FormComponentFeedbackPanels so that each component displays an error message next to itself somewhere and only a single "please correct errors indicated below" message is shown above the form.
Isn't some way to remove messages, depending on the 
key of that message? This way, it would be easy to clear messages that were loaded from 
RequiredValidator key.in 1.2 we dont have a RequiredValidator, nor a TypeValidator. those two things are performed by the form component itself, so this makes it even trickier to do what you want.
i guess if we do want to support something like this it will take a bit of thought. maybe you can come up with an idea.-Igor 
On 5/7/06, Igor Vaynberg <
[EMAIL PROTECTED]
> wrote:

On 5/7/06, Bruno Borges <[EMAIL PROTECTED]
> wrote:
The feedbackPanel is using IDs at the rendered html to display error messages from the form validation. How do I map labels to fields, and so FeedbackPanel can automatically catch this information to use the Labels, not IDs ?
you can call FormComponent.setLabel(IModel label) on the form components and then use ${label} var in the validator messages. 


And how should I proceed if I want to clear all the messages and put only one? Instead of letting FeedbackPanel display one message for each field in my form, I want to put a message like "Please fill all required fields.". But I don't wanna check each field manually in the validate() method.
This is tricky because this is not the usecase the feedbackpanel was designed for. the panel doesnt know about validators that failed, only about the messages. i guess if you wanted to you can check for "required" in the message?
-Igor

-- Bruno Borges
[EMAIL PROTECTED]Sun Certified Java Programmer for 1.4Sun Certified Web Component Developer for 
1.4




Re: [Wicket-user] Components Label for FeedbackMessage

2006-05-07 Thread Bruno Borges
you can call FormComponent.setLabel(IModel label) on the form components and then use ${label} var in the validator messages.
The problem here is that I already have in my html, and all my messages are in html. I'm using i18n directly there. (Page_en.html, Page_br.html, etc...).
Isn't a better way to do this?This is tricky because this is not the usecase the feedbackpanel was
designed for. the panel doesnt know about validators that failed, only
about the messages. i guess if you wanted to you can check for
"required" in the message?
I know I can iterate through all messages that are going to be displayed at the FeedbackPanelprotected void onError() {FeedbackMessages msgs = getFeedbackMessages();
... }If I look for 'required' in the message, how about i18n? :DAnd yes, the usecase is kind of common. Let's say the form has 20 fields, all of them are required. Some of them have mask, others are URLs, E-mails, Dates, etc. I don't wanna display one message for each field because it's required and other messages because of  some validation error.
Wouldn't be better display only one message saying: "Dude, please fill all required fields!"Isn't some way to remove messages, depending on the key of that message? This way, it would be easy to clear messages that were loaded from 
RequiredValidator key. On 5/7/06, Igor Vaynberg <[EMAIL PROTECTED]
> wrote:
On 5/7/06, Bruno Borges <[EMAIL PROTECTED]
> wrote:
The feedbackPanel is using IDs at the rendered html to display error messages from the form validation. How do I map labels to fields, and so FeedbackPanel can automatically catch this information to use the Labels, not IDs ?
you can call FormComponent.setLabel(IModel label) on the form components and then use ${label} var in the validator messages. 

And how should I proceed if I want to clear all the messages and put only one? Instead of letting FeedbackPanel display one message for each field in my form, I want to put a message like "Please fill all required fields.". But I don't wanna check each field manually in the validate() method.
This is tricky because this is not the usecase the feedbackpanel was designed for. the panel doesnt know about validators that failed, only about the messages. i guess if you wanted to you can check for "required" in the message?
-Igor

-- Bruno Borges[EMAIL PROTECTED]Sun Certified Java Programmer for 1.4Sun Certified Web Component Developer for 
1.4


Re: [Wicket-user] Components Label for FeedbackMessage

2006-05-07 Thread Igor Vaynberg
On 5/7/06, Bruno Borges <[EMAIL PROTECTED]> wrote:
The feedbackPanel is using IDs at the rendered html to display error messages from the form validation. How do I map labels to fields, and so FeedbackPanel can automatically catch this information to use the Labels, not IDs ?
you can call FormComponent.setLabel(IModel label) on the form components and then use ${label} var in the validator messages. 
And how should I proceed if I want to clear all the messages and put only one? Instead of letting FeedbackPanel display one message for each field in my form, I want to put a message like "Please fill all required fields.". But I don't wanna check each field manually in the validate() method.
This is tricky because this is not the usecase the feedbackpanel was designed for. the panel doesnt know about validators that failed, only about the messages. i guess if you wanted to you can check for "required" in the message?
-Igor


[Wicket-user] Components Label for FeedbackMessage

2006-05-07 Thread Bruno Borges
The feedbackPanel is using IDs at the rendered html to display error messages from the form validation. How do I map labels to fields, and so FeedbackPanel can automatically catch this information to use the Labels, not IDs ?
And how should I proceed if I want to clear all the messages and put only one? Instead of letting FeedbackPanel display one message for each field in my form, I want to put a message like "Please fill all required fields.". But I don't wanna check each field manually in the validate() method.
Regards,-- Bruno Borges[EMAIL PROTECTED]Sun Certified Java Programmer for 1.4Sun Certified Web Component Developer for 1.4