I am using Struts 2 (tried 2.0.1-2.0.6) and am having bizarre behavior with the select tag in a jsp page.

My code looks like this:

 <s:form name="editCredential" action="step4">
        ....
<s:select list="credential.credentialGenerators" emptyOption="true" listKey="name" listValue="name"/>

<s:submit value="%{getText('credwizard.step3.submit')}" id="hider"/>
</s:form>

When I do this the list gets displayed with the fully qualified class name of the bean with the ID, instead of the name and description fields. (almost as if it can't find them)

My current work around is to create the select by hand with:

<s:form name="editCredential" action="step4">
        ....
        <tr>
<td class="tdLabel"><label for="step4_credential_generator" class="label"><s:text name="credwizard.step3.generator"/></label></td>
            <td>
                <select name="credential.generator" id="step4_">
<s:iterator value="credential.credentialGenerators"> <option value="<s:property value="name"/ >"><s:property value="name"/></option>
                    </s:iterator>
                </select>
            </td>
        </tr>
<s:submit value="%{getText('credwizard.step3.submit')}" id="hider"/>
</s:form>

--------------------

So my question is, why does the struts iterator tag perform the traversal of the list correctly and the struts select tag does not? Any advise on how to 'make it work' would be appreciated.

Oh and BTW I have several other selects in my app, and they all work fine.

Thanks,
Brian-

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

Reply via email to