You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhaskar Gopalan <bg...@adaptintel.com> on 2002/04/01 19:16:18 UTC
Trimming strings in html:options
Hi,
I am dynamically populating a options field from the database. For this I am
getting an ArrayList
of strings that are formatted as id:value.
Code:
<%
PipelineFilterForm pipelineFilterForm =
(PipelineFilterForm)session.getAttribute("PipelineFilterForm");
java.util.ArrayList statusOptions = pipelineFilterForm.getStatusOptions();
if(statusOptions != null) {
pageContext.setAttribute("statusOptions", statusOptions,
PageContext.PAGE_SCOPE);
%>
<html:select size="1" property="stageVal">
<html:option value="0">Select One</html:option>
<html:options name="statusOptions"/>
</html:select>
The options displayed are id:value which is ok. But I want to set the value
of each option
equal to the 'id' part of the string. Is there any way to do this?
Also, line 2 of the code shows how I access the formBean from the form. Is
there any other
way to acheive this?
Thanks,
Bhaskar
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>