簡體   English   中英

使用Struts2-jQuery標簽的下拉列表

[英]Dropdown Check List using Struts2-jQuery tags

我需要在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>

只需使用簡單的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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM