struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: a paralell tag to html:select
Date Fri, 09 Sep 2005 01:46:07 GMT
Rivka Shisman wrote:
> Does someone know a parallel tag to html:select?
> 
> I mean that if in the Edit.jsp page i had an html:select tag to edit the
> student_status field - and in the displayStudents.jsp i have a
> bean:write to display the student_status field
> 
> What id the best way to get the decode in the display page (as the
> html:select tag does) - because now what is displayed is the code itself
> (the value) and i need the label from the LabelValueBean.

There isn't a direct equivalent to <options/>'s name/property attributes 
for <bean:write/> (I think that's what you are asking for?) You'll need 
to write the appropriate value from your LabelValueBean yourself. The 
easiest way would be to add a method, Map getLabelMap(), to your bean 
which returns an status to label map. Then, in your dosplayStudents.jsp, 
you can write the label value with

   ${labelBean.labelMap[student.student_status]}

or something like

   <bean:write name="labelBean" property="labelMap['<% 
student.getStudent_Status()%>']"/>

If that doesn't get you going, post your source code so I can see what 
you have to work with.

L.


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


Mime
View raw message