Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5F81DBC9 for ; Fri, 28 Dec 2012 08:41:56 +0000 (UTC) Received: (qmail 62136 invoked by uid 500); 28 Dec 2012 08:41:55 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 61774 invoked by uid 500); 28 Dec 2012 08:41:54 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 60679 invoked by uid 99); 28 Dec 2012 08:41:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Dec 2012 08:41:53 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.250.139 is neither permitted nor denied by domain of murthy.mvvr@gmail.com) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Dec 2012 08:41:47 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1ToVVP-0000Hh-9o for users@wicket.apache.org; Fri, 28 Dec 2012 00:41:27 -0800 Date: Fri, 28 Dec 2012 00:41:27 -0800 (PST) From: wicket_new_user To: users@wicket.apache.org Message-ID: <1356684087272-4655091.post@n4.nabble.com> Subject: Issue while adding Custom Validator to ListMultipleChoice component MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, is it possible to add Custom Validator (implenting IValidator) for ListMultipleChoice component? when i'm trying to add validator to the the componnent using the below code, final ListMultipleChoice selectedFields = new ListMultipleChoice("selected", new ListModel(new ArrayList()), availableAttributesModel, FIELD_RENDERER); selectedFields.setOutputMarkupId(true); s*electedFields.add(new SelectedAttributesValidator());* i'm seeing the below compilation error for the above statement *The method add(IValidator>) in the type FormComponent> is not applicable for the arguments (SelectedAttributesValidator)* Following is the Validator Class ========================= public class SelectedAttributesValidator implements IValidator> { /** * */ private static final long serialVersionUID = 1L; /** * */ public void validate(IValidatable> validatable) { final ListMultipleChoice selectedFields = validatable.getValue(); if (CollectionUtils.isEmpty(selectedFields.getChoices())) { validatable.error(new ValidationError().addMessageKey("attributesMustBeSelected")); } } } the reason i'm going for Custom Validator is as i'm unable to get the value from the "getConvertedInput()" as it is showing always empty, when the form is loaded with default values. Not able to understand what could be the problem. can one please let me know, if there is any issue in the above code? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Issue-while-adding-Custom-Validator-to-ListMultipleChoice-component-tp4655091.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional commands, e-mail: users-help@wicket.apache.org