Java Mailing List Archive

Mailing List
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
LazyValidatorForm not accepting multiple selects

LazyValidatorForm not accepting multiple selects

2007-11-04       - By Donald Rosengartner


I recently joined a team using struts 1.3.8 and LazyValidatorForm. I can not
seem to get the following html:select to work. I have tried modifying the
datatype of the form bean property(ArrayList, String[], etc). String[] made the
first of my selections' values available in the Action, but no other selections
posted. I have javascript in place to make these selected options "selected",
so I'm sure the post is not the issue. Switching to the classic ActionForm, all
values become available with no JSP/javascript changes. My code follows:
<bean:define id="teams" name="DMAForm" property="teamCollection" type="java
<html:select property="schdTrnmtGamesSelected" multiple="true" size="10"
<html:options collection="teams" property="teamId" labelProperty="teamName" />
</html:select> Classic Struts accessor - String[] selectedTeams = dmaForm
.getSchdTrnmtGamesSelected();with LazyValidatorForm -String[] selectedTeams =
(String[]) dmaUserForm.get("schdTrnmtGamesSelected");// this gives
ClassCastException, but the next is fine at runtimeString selectedTeams =
(String) dmaUserForm.get("schdTrnmtGamesSelected");// defeats the purpose, as I
need all selections that I intended to post
I also tried to access as indexed property of the map, such as String
selectedTeam1 = (String) dmaUserForm.get("schdTrnmtGamesSelected", 0);String
selectedTeam2 = (String) dmaUserForm.get("schdTrnmtGamesSelected", 1);The
zeroeth index returns the same value as that above without the index[0], but
subsequent values of the index are not populated in the form.
Searching the archives for information on this, I find that String[] is the
correct datatype, but little if any information about mutiple=true concurrently
used with LazyValidatorForm.I need to get this working as I have a tiles header
that requires a lazyValidatorForm in scope. I have a workaround which forwards
to the init method(as if to read the calling page for the first time), however
I have other pages that are top-level and are broken until I find a fix.Thanks
in advance for suggestions givenD. Duane RosengartnerSogeti - Dallas Unit
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
Help yourself to FREE treats served up daily at the Messenger Caf?. Stop by

©2008 - Jax Systems, LLC, U.S.A.