1

用项目填充合金 UI 组合框后,如何设置选定项目?我的意思是,插入组合框中的项目之一应该是默认选中的项目。我该如何设置?

4

1 回答 1

3

jsp:

    <aui:select name="selectedCity" label="City:" id="selectedCity">
        <c:forEach items="${cities}" var="city">
            <aui:option value="${city}" label="${city}" selected="${selectedCity == city}"/>
        </c:forEach>
    </aui:select>

爪哇:

    renderRequest.setAttribute("selectedCity", selectedCity);
    List<String> cities = Lists.newArrayList("New Yourk", "Moskau", "London", "Rom");
    renderRequest.setAttribute("cities", cities);
于 2012-04-23T11:00:06.210 回答