I am new to struts but when I used the select with options tag I created 2 equal size 
vectors (labels, values)....the jsp was

<td>
  <html:select  name="incidentForm"  property="selectedUnsafe"  >
  <html:options name="incidentForm" property="unsafeValues" labelName="incidentForm" 
        labelProperty="unsafeLabels" />
  </html:select></TD>

or, in another case I used the iterate tag to create a list:

<logic:iterate id="test" 
        name="incidentForm"
        property="unsafe"
        type="GeneralForm"
>
  <tr>
    <td><html:submit property="removeUnsafe" value="Remove" /></td>
    <td><bean:write name="test" property="desc" filter="false"/></td>
    <td><html:hidden name="test" property="id" /></td>
  </tr> 
</logic:iterate>

Don't know if this is the correct way or not; but it worked for me !!
                                                                        

-----Original Message-----
From: Scott Power [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:18 PM
To: [EMAIL PROTECTED]
Subject: need Help, I have been struggling for days. (collections
andhtml:select)


I am trying to do something I have done many times before

I have a collection of objects which I want to use in a drop down menu
for the user.  
I have a vector that contains (int ids,Object ) 

In the object bean I have methods that get/set the values, for example


public String getCriteriaName(){.......}

In my jsp I have several text fields and I am able to get the values of
them in my action bean. This criteria is the only value I am having
trouble with. I get a Cannot find bean under name criteriaList.  I have
done this before with vectors of similar structure and I am really
confused.

<html:select property="criteriaName">
<html:options
        collection="criteriaList" 
        property="id" 
       labelProperty="criteriaName"/>
</html:select>


In my action form bean I make objects and put them in a vector then I
request.setAttribute/session.setAttribute depending on scope.

All I want to do is to get the string value back from what the user
selects.

If anybody can Help, it would be great.

Thanks in Advance.

Scott Power



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to