Description
Hi,
This error appears when i use in a form a Select List with Option Group
It appears not at the first time, but at the second time
Exception
Class java.lang.ClassCastException
Message net.sf.click.control.OptionGroup
731: if (getValue().length() == 0)
else {
735: if (getOptionList().isEmpty())
740:
741: Option firstOption = (Option) getOptionList().get(0);
742:
743: if (firstOption.getValue().equals(getValue()))
746: }
747: }
748: }
749: }
750:
751: // ------------------------------------------------------ Protected Methods
java.lang.ClassCastException: net.sf.click.control.OptionGroup
at net.sf.click.control.Select.validate(Select.java:741)
at net.sf.click.control.Field.onProcess(Field.java:853)
at net.sf.click.control.FieldSet.onProcess(FieldSet.java:536)
at net.sf.click.control.Form.onProcess(Form.java:1718)
at net.sf.click.ClickServlet.processPage(ClickServlet.java:555)
at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:356)
at net.sf.click.ClickServlet.doPost(ClickServlet.java:306)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Here is my source code :
List localOptions = new ArrayList();
Select localSelect = new Select("local.numLocal","Lieu de travail");
List<Local> listCollege = new LocalDAO().findByCommuneAndType(communeSelect.getValue(),"Collège");
List<Local> listSSD = new LocalDAO().findByCommuneAndType(communeSelect.getValue(),"SSD");
List<Local> listPMI = new LocalDAO().findByCommuneAndType(communeSelect.getValue(),"PMI");
List<Local> listCDDS = new LocalDAO().findByCommuneAndType(communeSelect.getValue(),"CDDS");
List<Local> listCGVO = new LocalDAO().findByCommuneAndType(communeSelect.getValue(),"CGVO");
if (!listCollege.isEmpty()) {
OptionGroup college = new OptionGroup("Collège");
for (Iterator iter = listCollege.iterator(); iter.hasNext()
localOptions.add(college);
}
if (!listSSD.isEmpty()) {
OptionGroup ssd = new OptionGroup("SSD");
for (Iterator iter = listSSD.iterator(); iter.hasNext()
localOptions.add(ssd);
}
if (!listPMI.isEmpty()) {
OptionGroup pmi = new OptionGroup("PMI");
for (Iterator iter = listPMI.iterator(); iter.hasNext()
localOptions.add(pmi);
}
if (!listCDDS.isEmpty()) {
OptionGroup cdds = new OptionGroup("CDDS");
for (Iterator iter = listCDDS.iterator(); iter.hasNext()
localOptions.add(cdds);
}
if (!listCGVO.isEmpty()) {
OptionGroup cgvo = new OptionGroup("CGVO");
for (Iterator iter = listCGVO.iterator(); iter.hasNext()
localOptions.add(cgvo);
}
localSelect.setOptionList(localOptions);
localSelect.setRequired(true);