Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 87206 invoked from network); 28 Jul 2006 19:45:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jul 2006 19:45:22 -0000 Received: (qmail 50615 invoked by uid 500); 28 Jul 2006 19:45:20 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 50542 invoked by uid 500); 28 Jul 2006 19:45:20 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 50531 invoked by uid 99); 28 Jul 2006 19:45:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jul 2006 12:45:20 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mwessendorf@gmail.com designates 72.14.214.205 as permitted sender) Received: from [72.14.214.205] (HELO hu-out-0102.google.com) (72.14.214.205) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jul 2006 12:45:17 -0700 Received: by hu-out-0102.google.com with SMTP id 22so522226hug for ; Fri, 28 Jul 2006 12:44:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=dkJwdfPK46oPYkaDDZbnSIZPOqpZl7VZePMu2DgDSlA/POQX17v5WNKrSO02ZDddy2uatCeMV9rEBjVrgwJiB05YwPAVaFWVwIIqIktGVZ8GMb7naFNAW/l5krRJra9pWLXZvApKVBDthKFk+Oi5RWbazCxQuB/Tql3ypn9Uga8= Received: by 10.66.243.2 with SMTP id q2mr8996218ugh; Fri, 28 Jul 2006 12:44:56 -0700 (PDT) Received: by 10.66.240.9 with HTTP; Fri, 28 Jul 2006 12:44:55 -0700 (PDT) Message-ID: <71235db40607281244u361b4249lc3c32e9a4a1a7a7c@mail.gmail.com> Date: Fri, 28 Jul 2006 12:44:55 -0700 From: "Matthias Wessendorf" Sender: mwessendorf@gmail.com To: "MyFaces Development" Subject: Re: ValidateCompareToTag In-Reply-To: <8f985b960607281116r371987b4gb8cdd641618b4c76@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8f985b960607281116r371987b4gb8cdd641618b4c76@mail.gmail.com> X-Google-Sender-Auth: f0bd18cbc63aa1a4 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 7/28/06, Mike Kienenberger wrote: > Thanks. > > That looks like the correct fix to me. I never used the comparator > attribute myself, and I created the accessors by copying the String > accessors. > > Can you open a JIRA issue in Tomahawk for this and attach your patch? > Feel free to assign the issue to me. that is not possible :) which is not bad ;) > > On 7/28/06, MT3 MTCube wrote: > > We have used the with the "comparator" attribute, we > > have inserted a value binding (like comparator=#{bean.myComparator}) in the > > attribute but we have received this exception: > > > > java.lang.ClassCastException: comparator must be type interface > > java.util.Comparator but is type class java.lang.String > > at > > org.apache.myfaces.custom.comparetovalidator.CompareToValidator.createComparator(CompareToValidator.java:347) > > at > > org.apache.myfaces.custom.comparetovalidator.CompareToValidator.validate(CompareToValidator.java:292) > > > > even if we get a java.util.Comparator from the bean. > > We have solved the problem with this patch: > > > > Index: > > C:/current/tomahawk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/ValidateCompareToTag.java > > =================================================================== > > --- > > C:/current/tomahawk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/ValidateCompareToTag.java > > (revision 425405) > > +++ > > C:/current/tomahawk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/ValidateCompareToTag.java > > (working copy) > > @@ -71,7 +71,7 @@ > > if (_comparator != null) > > { > > ValueBinding vb = > > facesContext.getApplication().createValueBinding(_comparator); > > - validator.setComparator(vb.getValue(facesContext).toString()); > > + validator.setComparator(vb.getValue(facesContext)); > > } > > > > if (_foreignComponentName != null) > > > > > > with this correction the "comparator" property receives the object instead > > at first it receives a String (the cause of the later exception). > > Is it correct or we have used the comparator attribute in a wrong way? > > > > Thanks to all, > > Mt3 > -- Matthias Wessendorf further stuff: blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com