RE: Very strange problem: conversion error
Yup, that it is. Not that I solved the problem, but I did discover it's localized to one machine. Everything works fine in every other environment I've tried it in. So, I can only assume it's not a problem with the code at this point. Thanks! Taylor From: Grant Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 5:49 PMTo: MyFaces DiscussionSubject: Re: Very strange problem: conversion error Recent changes to SelectItem in 1.1.5 SNAPSHOT remove the convenient conversion between types for this component to make it work like the RI. Is #{TransactionReportBean.beginHour} a String ? On 11/14/06, Fraley, Taylor <[EMAIL PROTECTED]> wrote: So I'm having a very strange problem. I have a jsp that's using ah:selectOneMenu populated by an ArrayList within a bean, which is allpretty standard. In one environment, on my desktop PC running Tomcat5.5, everything works fine. On my SPARC running the same version of Tomcat, configured, from what I can tell, identically, I get thefollowing exception when loading the page:org.apache.jasper.JasperException: org.apache.jasper.JasperException:javax.servlet.jsp.JspException : "{2}" Conversion Error setting value''{0}'' for ''{1}''.org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:377)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)javax.servlet.http.HttpServlet.service (HttpServlet.java:802)org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)I've done some poking around on Google, but haven't found anythingterribly useful. The two possible explanations I've found (getter for the ArrayList returning null and a mistype of the managed bean name inthe jsp vs. the faces-config.xml) both don't seem to apply here. Hereare the relevant snippets of code:...from faces-config.xml... TransactionReportBeancom.level3.ssid.idd.report.web.TransactionReportBean session...from the TransactionReportBean... public TransactionReportBean() { availableTimes.add(new SelectItem("0", "12:00 AM")); availableTimes.add(new SelectItem("1", "01:00 AM")); availableTimes.add(new SelectItem("2", "02:00 AM")); availableTimes.add(new SelectItem("3", "03:00 AM")); availableTimes.add(new SelectItem("4", "04:00 AM")); availableTimes.add(new SelectItem("5", "05:00 AM")); availableTimes.add(new SelectItem("6", "06:00 AM")); availableTimes.add(new SelectItem("7", "07:00 AM")); availableTimes.add(new SelectItem("8", "08:00 AM")); availableTimes.add(new SelectItem("9", "09:00 AM")); availableTimes.add(new SelectItem("10", "10:00 AM")); availableTimes.add(new SelectItem("11", "11:00 AM")); availableTimes.add(new SelectItem("12", "12:00 PM")); availableTimes.add(new SelectItem("13", "01:00 PM")); availableTimes.add(new SelectItem("14", "02:00 PM")); availableTimes.add(new SelectItem("15", "03:00 PM")); availableTimes.add(new SelectItem("16", "04:00 PM")); availableTimes.add(new SelectItem("17", "05:00 PM")); availableTimes.add(new SelectItem("18", "06:00 PM")); availableTimes.add(new SelectItem("19", "07:00 PM")); availableTimes.add(new SelectItem("20", "08:00 PM")); availableTimes.add(new SelectItem("21", "09:00 PM")); availableTimes.add(new SelectItem("22", "10:00 PM")); availableTimes.add(new SelectItem("23", "11:00 PM")); } public ArrayList getAvailableCnamOptions() { return availableCnamOptions; }...from the jsp...value="#{TransactionReportBean.beginHour}" styleClass="rptSmallInputs"> Judging by all the hits on Google, it seems to be a pretty commonproblem, but I'm sort of stumped on what to do next to figure out the problem. Has anyone seen this? Any pointers?Thanks,Taylor-- Grant Smith
Very strange problem: conversion error
So I'm having a very strange problem. I have a jsp that's using a h:selectOneMenu populated by an ArrayList within a bean, which is all pretty standard. In one environment, on my desktop PC running Tomcat 5.5, everything works fine. On my SPARC running the same version of Tomcat, configured, from what I can tell, identically, I get the following exception when loading the page: org.apache.jasper.JasperException: org.apache.jasper.JasperException: javax.servlet.jsp.JspException: "{2}" Conversion Error setting value ''{0}'' for ''{1}''. org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle tWrapper.java:512) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:377) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFil ter.java:144) I've done some poking around on Google, but haven't found anything terribly useful. The two possible explanations I've found (getter for the ArrayList returning null and a mistype of the managed bean name in the jsp vs. the faces-config.xml) both don't seem to apply here. Here are the relevant snippets of code: ...from faces-config.xml... TransactionReportBean com.level3.ssid.idd.report.web.TransactionReportBean session ...from the TransactionReportBean... public TransactionReportBean() { availableTimes.add(new SelectItem("0", "12:00 AM")); availableTimes.add(new SelectItem("1", "01:00 AM")); availableTimes.add(new SelectItem("2", "02:00 AM")); availableTimes.add(new SelectItem("3", "03:00 AM")); availableTimes.add(new SelectItem("4", "04:00 AM")); availableTimes.add(new SelectItem("5", "05:00 AM")); availableTimes.add(new SelectItem("6", "06:00 AM")); availableTimes.add(new SelectItem("7", "07:00 AM")); availableTimes.add(new SelectItem("8", "08:00 AM")); availableTimes.add(new SelectItem("9", "09:00 AM")); availableTimes.add(new SelectItem("10", "10:00 AM")); availableTimes.add(new SelectItem("11", "11:00 AM")); availableTimes.add(new SelectItem("12", "12:00 PM")); availableTimes.add(new SelectItem("13", "01:00 PM")); availableTimes.add(new SelectItem("14", "02:00 PM")); availableTimes.add(new SelectItem("15", "03:00 PM")); availableTimes.add(new SelectItem("16", "04:00 PM")); availableTimes.add(new SelectItem("17", "05:00 PM")); availableTimes.add(new SelectItem("18", "06:00 PM")); availableTimes.add(new SelectItem("19", "07:00 PM")); availableTimes.add(new SelectItem("20", "08:00 PM")); availableTimes.add(new SelectItem("21", "09:00 PM")); availableTimes.add(new SelectItem("22", "10:00 PM")); availableTimes.add(new SelectItem("23", "11:00 PM")); } public ArrayList getAvailableCnamOptions() { return availableCnamOptions; } ...from the jsp... Judging by all the hits on Google, it seems to be a pretty common problem, but I'm sort of stumped on what to do next to figure out the problem. Has anyone seen this? Any pointers? Thanks, Taylor
RE: JSF + Javascript question
Thanks for the info. Checking the client-side generated ids was actually the first thing I tried, and for some reason, it's still not working as expected. That could very well be a problem with my javascript, and I won't ask anyone to debug that for me -- I'll take care of it :) My only problem now is how to check the "checked" status of the boolean checkbox from within the script. Thanks, Taylor -Original Message- From: Jeff Bischoff [mailto:[EMAIL PROTECTED] Sent: Friday, November 10, 2006 12:22 PM To: MyFaces Discussion Subject: Re: JSF + Javascript question Nebinger, David wrote: > Obviously there would be other ways to skin this cat, but it should all work just fine... He's right. If you use the right client-side id, it should work. However, client ids in JSF can get real messy. I would highly recommend the other ways. (to skin the cat - it makes some great soup!) For example, you can use the "disabled" and "rendered" attributes on JSF components to control their status. If you do not want to submit the entire form, there are several ways around that: e.g. s:subForm or AJAX frameworks like Ajax4jsf. But if you're determined to stick with quick & dirty (hey so was I, when I first started using JSF), you will need to be aware of those client ids. Regards, Jeff Bischoff Kenneth L Kurz & Associates, Inc. Nebinger, David wrote: > Without info re: falling flat, my guess is you're not accommodating the real ID of the control on the HTML side. Your javascript will probably work just fine if you a) pass the real id (effectively the client id on the JSF side), or b) iterate through the controls looking for a control with the id that ends with your logically-assigned id. Obviously there would be other ways to skin this cat, but it should all work just fine... > > -Original Message- > From: Fraley, Taylor [mailto:[EMAIL PROTECTED] > Sent: Friday, November 10, 2006 2:01 PM > To: MyFaces Discussion > Subject: JSF + Javascript question > > > Does anyone know a quick and dirty way to disable a set of JSF form elements based on the checked status of a h:selectBooleanCheckbox? I have some Javascript that works great when using normal HTML elements, but falls flat when I'm using faces. > > Thanks, > Taylor > > >
JSF + Javascript question
Does anyone know a quick and dirty way to disable a set of JSF form elements based on the checked status of a h:selectBooleanCheckbox? I have some _javascript_ that works great when using normal HTML elements, but falls flat when I'm using faces. Thanks, Taylor
RE: Problem with tomahawk calendar in remote browser
Yup, I was able to track it down. Thanks for the help! Taylor -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Thursday, November 09, 2006 4:38 PM To: MyFaces Discussion Subject: Re: Problem with tomahawk calendar in remote browser Fraley, Taylor wrote: > First, let me say I'm relatively new to myfaces and tomahawk, so > please be kind :) > > So, I'm using: > > myfaces 1.1.4 > tomahawk 1.1.3 > tomcat 5.5 > > I'm using the Tomahawk calendar as a popup. Everything works great > locally on my development machine where everything is running, in both > IE7 and Firefox 2. But when the page is rendered in a remote browser, > all that displays is the calendar's input text box, sans button. IE 6 > on a remote machine reports the following javascript error: > > Line: 136 > Char: 1 > Error: 'org_apache_myfaces_PopupCalendar' is undefined > Code: 0 > > The generated source is identical between the local browser and the > remote. My guess is that there's something up with my web.xml, or > perhaps a problem on Tomcat or something. I'll paste my web.xml > below. If anyone has any pointers or insight, that would be great. I would guess that the remote browser is failing to fetch the stylesheets for the calendar (and possibly icons etc). The generated page will be referring to various resource files back on the original server; these references will be using a special URL that gets intercepted by the myfaces ExtensionsFilter to locate and return the appropriate resource from inside the tomahawk jarfile. If it's working on your machine, then it looks like the ExtensionsFilter is ok though. I don't know what would be different about the remote system in this regard. You might want to turn on logging output, and see what differences there are in the messages logged by the ExtensionsFilter when accessed locally vs remotely. Regards, Simon
Problem with tomahawk calendar in remote browser
First, let me say I'm relatively new to myfaces and tomahawk, so please be kind :) So, I'm using: myfaces 1.1.4 tomahawk 1.1.3 tomcat 5.5 I'm using the Tomahawk calendar as a popup. Everything works great locally on my development machine where everything is running, in both IE7 and Firefox 2. But when the page is rendered in a remote browser, all that displays is the calendar's input text box, sans button. IE 6 on a remote machine reports the following _javascript_ error: Line: 136 Char: 1 Error: 'org_apache_myfaces_PopupCalendar' is undefined Code: 0 The generated source is identical between the local browser and the remote. My guess is that there's something up with my web.xml, or perhaps a problem on Tomcat or something. I'll paste my web.xml below. If anyone has any pointers or insight, that would be great. Thanks,Taylor > web.xml xml version="1.0" encoding="UTF-8"?>IDDReportsdisplay-name> Idd Reporting Applicationdescription> javax.faces.STATE_SAVING_METHODparam-name> clientparam-value> context-param> Faces Servletservlet-name> javax.faces.webapp.FacesServletservlet-class> 1load-on-startup> servlet> Faces Servletservlet-name> /reports/*url-pattern> servlet-mapping> Faces Servletservlet-name> *.jsfurl-pattern> servlet-mapping> Faces Servletservlet-name> /faces/*url-pattern> servlet-mapping> MyFacesExtensionsFilterfilter-name> org.apache.myfaces.webapp.filter.ExtensionsFilterfilter-class> filter> MyFacesExtensionsFilterfilter-name> *.jsfurl-pattern> filter-mapping> MyFacesExtensionsFilterfilter-name> Faces Servletservlet-name> filter-mapping> MyFacesExtensionsFilterfilter-name> /faces/*url-pattern> filter-mapping> web-app>