Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 6249 invoked from network); 30 Mar 2007 22:29:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Mar 2007 22:29:40 -0000 Received: (qmail 43201 invoked by uid 500); 30 Mar 2007 22:29:36 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 43137 invoked by uid 500); 30 Mar 2007 22:29:36 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 43110 invoked by uid 99); 30 Mar 2007 22:29:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 15:29:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 15:29:27 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HXPak-0000OD-Nx for users@myfaces.apache.org; Fri, 30 Mar 2007 15:29:06 -0700 Message-ID: <9762021.post@talk.nabble.com> Date: Fri, 30 Mar 2007 15:29:06 -0700 (PDT) From: fastbob To: users@myfaces.apache.org Subject: Re: ERROR: Value is not a valid option In-Reply-To: <8f985b960702260950g449eac33j1a0ae2f131fafb2f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: fastbob@gmail.com References: <6dda0b150702240219y5c58e8fbjf109c0942ad3dd64@mail.gmail.com> <9155607.post@talk.nabble.com> <1172509649.3992.20.camel@localhost> <8f985b960702260926s7f91558dlc2c52d63ceb19884@mail.gmail.com> <8f985b960702260950g449eac33j1a0ae2f131fafb2f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Mike Kienenberger wrote: >=20 > Yes, that's how I would do it. If you specify an itemValue, then that > value must be of the correct type. Ie, " " is not a containerType > (Srinivas) and "0" is not a region (Carl). >=20 Ouch. The assumption is that there is a one-one correspondence between the list items and the type in the model. This isn't always the case. We had a number of JSP's under 1.1.3 with the following sequence, for several different types of lists: The values in the type are fixed (essentially an enumeration, but not implemented that way), and there is no "empty" value available. Instead, if the converters are passed a null or empty string for conversion to the underlying type, they immediately return null. So in this case null is used to indicate no value has been selected by the user, and they get an error. With 1.1.5, we get the following exception: java.lang.ClassCastException: java.lang.String cannot be cast to javax.ejb.EJBLocalObject at org.jboss.ejb.plugins.local.LocalProxy.isIdentical(LocalProxy.java:124) at org.jboss.ejb.plugins.local.LocalProxy.invoke(LocalProxy.java:174) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:40) at org.jboss.ejb.plugins.local.LocalProxy.invoke(LocalProxy.java:155) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:40) at $Proxy262.equals(Unknown Source) at javax.faces.component._SelectItemsUtil.matchValue(_SelectItemsUtil.java:65) at javax.faces.component.UISelectOne.validateValue(UISelectOne.java:56) at javax.faces.component.UIInput.validate(UIInput.java:354) at javax.faces.component.UIInput.processValidators(UIInput.java:184) [=E2=80=A6] Here are the relevant lines from _SelectItemsUtil.MatchValue(): [item is class SelectItem] Object itemValue =3D item.getValue(); if (value=3D=3DitemValue || value.equals(itemValue)) The exception is thrown by the call to equals in an EJB. I haven't come up with a low-cost way to fix this. Bob --=20 View this message in context: http://www.nabble.com/ERROR%3A-Value-is-not-a= -valid-option-tf3270984.html#a9762021 Sent from the MyFaces - Users mailing list archive at Nabble.com.