Hm, sorry, it's more generally useful to do: <html:option value="<%= String.valueOf(courseid) %>">
Quoting Kris Schneider <[EMAIL PROTECTED]>: > The handler for the <html:option> tag expects a String for the "value" > property. > Try: > > <bean:define id="courseid" > name="courses" > property="oekoid" > type="String"/> > > or: > > <html:option value="<%= (String)courseid %>"> > > Assuming "courseid" really *is* a String... > > Quoting Heather Buch <[EMAIL PROTECTED]>: > > > I set up what you suggested: > > > > <html:select property="addchosencourseids" size="1"> > > <logic:iterate id="courses" name="availablecourses"> > > <bean:define id="courseid" name="courses" property="oekoid"/> > > <html:option value="<%= courseid %>"> > > <bean:write name="courseid"/><bean:write name="courses" > > property="name"/> > > </html:option> > > </logic:iterate> > > </html:select> > > > > instead of this: > > > > <html:select multiple="true" size="10" property="addchosencourseids"> > > <html:options collection="availablecourses" labelProperty="displayLabel" > > property="courseinstanceid" /> > > </html:select> > > > > > > and I get this error: > > > > 2003-01-31 15:59:41 Error compiling file: > > > /usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/work/Standalone/localhost/oecon-stprg/pageparts/editschedule_0002dbody_jsp.java > > [javac] Compiling 1 source file > > > > > /usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/work/Standalone/localhost/oecon-stprg/pageparts/editschedule_0002dbody_jsp.java:256: > > cannot resolve symbol > > symbol : method setValue (java.lang.Object) > > location: class org.apache.struts.taglib.html.OptionTag > > _jspx_th_html_option_0.setValue( courseid ); > > ^ > > 1 error > > > > 2003-01-31 15:59:41 ApplicationDispatcher[/oecon-stprg] Servlet.service() > > for > > servlet jsp threw exception > > org.apache.jasper.JasperException: Unable to compile class for JSP > > > > An error occurred at line: 85 in the jsp file: > > /pageparts/editschedule-body.jsp > > > > Generated servlet error: > > [javac] Compiling 1 source file > > > > > /usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/work/Standalone/localhost/oecon-stprg/pageparts/editschedule_0002dbody_jsp.java:256: > > cannot resolve symbol > > symbol : method setValue (java.lang.Object) > > location: class org.apache.struts.taglib.html.OptionTag > > _jspx_th_html_option_0.setValue( courseid ); > > ^ > > 1 error > > > > > > > > Am I missing something? > > > > Thanks, > > > > Heather > > > > > > > > > > > > > > > > > > --------------------- > > > > original message: > > > > > > Heather, > > > > What exactly do you mean by "doesn't work"? Is an exception thrown? Is > the > > output rendered incorrectly? > > > > Quoting Heather Buch <[EMAIL PROTECTED]>: > > > > > No, it doesn't. At least it didn't for me. "value" from <html:option > > > value="<%= firstName %>"> doesn't work. > > > > > > It would be so great if there were a way to create a concatenated label > > for > > > a > > > select menu. Currently, I have a getDisplay() in some of my beans, > which > > > returns a concatenation of some other strings. I present it like this: > > > > > > <html:select multiple="true" size="10" property="addchosencourseids"> > > > <html:options collection="availablecourses" > labelProperty="displayLabel" > > > property="courseinstanceid" /> > > > </html:select> > > > > > > It would be so nice to create the option label dynamically. Then I > could > > > combine <bean:message key="whatever"/> tags with the bean values, or > > > whatever. > > > > > > Best, > > > > > > Heather Buch > > > > > > Think this'll work: > > > > > > <html:select property="myFormField" size="1"> > > > <logic:iterate id="name" name="Names"> > > > <bean:define id="firstName" name="name" property="first_name"/> > > > <html:option value="<%= firstName %>"> > > > <bean:write name="firstName"/><bean:write name="name" > > > property="last_name"/> > > > </html:option> > > > </logic:iterate> > > > </html:select> > > > > > > Quoting "Cook, Graham" <[EMAIL PROTECTED]>: > > > > > > > > > > > Hi, Im using the RowSetDynaClass to produce a java.util.List of > values > > > from > > > > a database which are displayed in > > > > the JSP as follows:- > > > > > > > > > > > > > > > > > > <html:select property="myFormField" size="1"> > > > > <html:options collection="Names" property="first_name" > > > > labelProperty="first_name" /> > > > > </html:select> > > > > > > > > > > > > What I would like to do is concatenate two fields in the > java.util.List > > > and > > > > use that as the labelProperty so the HTML OPTIONS would have a value > of > > > > firstname and a label of firstname and lastname. > > > > > > > > Has anyone got an idea on how to concatenate please? > > > > > > > > > > > > > > > > > > ******************************************************************************************** > > > > " This message contains information that may be privileged or > > > confidential > > > > and > > > > is the property of the Cap Gemini Ernst & Young Group. It is intended > > > only > > > > for > > > > the person to whom it is addressed. If you are not the intended > > > recipient, > > > > you > > > > are not authorized to read, print, retain, copy, disseminate, > > distribute, > > > or > > > > use > > > > this message or any part thereof. If you receive this message in > error, > > > > please > > > > notify the sender immediately and delete all copies of this message > ". > > > > > > > > > > ******************************************************************************************** > > > > > > > > > > > > -- > > > > To unsubscribe, e-mail: > > > > <mailto:[EMAIL PROTECTED]> > > > > For additional commands, e-mail: > > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > -- > > > Kris Schneider <mailto:[EMAIL PROTECTED]> > > > D.O.Tech <http://www.dotech.com/> > > > > > > -- > > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > Heather Buch > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > Heather Buch > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > Kris Schneider <mailto:[EMAIL PROTECTED]> > D.O.Tech <http://www.dotech.com/> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Kris Schneider <mailto:[EMAIL PROTECTED]> D.O.Tech <http://www.dotech.com/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]