0

我需要在 Struts2 - jQuery 项目中实现多选下拉列表。

我正在使用 sj:select 标记从使用 AJAX 和 JSON 的操作类中加载数据。

但是,我需要列表是一个下拉列表,并且可以选择多选。

我尝试使用http://code.google.com/p/dropdown-check-list/但这对 sj:select 标签不起作用。

这是我的代码:-

    <s:url var="list2URL" action="licenseGeneration" />

<s:form id="subgroupForm" action="licenseGeneration" method="get"
    theme="css_xhtml">
    <table>
        <tr>
            <td>
                <div>Select Product Family:</div>
            </td>
            <td><sj:select href="%{list2URL}" id="selectedSubgroup"
                    onChangeTopics="featuresList,productsList" name="selectedSubgroup"
                    list="subgroups" emptyOption="false" headerKey="-1"
                    headerValue="Please select a Sub Group">
                </sj:select></td>
        </tr>
        <tr>
            <td>
                <div>Select Product Name:</div>
            </td>
            <td>
                <div>
                    <sj:select href="%{list2URL}" id="selectWithReloadTopic"
                        formIds="subgroupForm" reloadTopics="productsList"
                        name="products" list="productLevelSKUs" emptyOption="false"
                        headerKey="-1" headerValue="Please Select a Product">
                    </sj:select>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div>Select Features:</div>
            </td>
            <td>
                <div>
                    <sj:select href="%{list2URL}" id="selectWithReloadTopic2"
                        formIds="subgroupForm" reloadTopics="featuresList"
                        name="features" list="featureLevelSKUs" emptyOption="false"
                        headerKey="-1" headerValue="Shift select for multiple features"
                        multiple="true">
                    </sj:select>
                </div>
            </td>
        </tr>
    </table>
</s:form>
4

1 回答 1

0

只需使用简单的 HTML,如下所示即可

 <select multiple="multiple">
      <option value="volvo">Volvo</option>
      <option value="saab">Saab</option>
      <option value="opel">Opel</option>
      <option value="audi">Audi</option>
    </select>
于 2012-11-21T07:00:02.937 回答