struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heather Buch" <hb...@www.thebuchs.dk>
Subject Re: RowSetDynaClass, select option
Date Fri, 31 Jan 2003 14:56:49 GMT
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 <hbuch@www.thebuchs.dk>:

> 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" <graham.cook@cgey.com>:
> 
> > 
> > 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:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> 
> -- 
> Kris Schneider <mailto:kris@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
> --
> To unsubscribe, e-mail:  
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 
> Heather Buch
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 




Heather Buch


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message