0

ハッシュマップのキーをラベルとして、値を値として設定した selectOneListBox があります。

リストの最初のオブジェクトをデフォルトの選択として設定し、ハイライト表示するにはどうすればよいですか

<!--the list box containing the results from the search-->
    <h:form id="newPointsResultList" styleClass="simpleformstyle">
        <p:selectOneListbox id="selectedPoints_listbox" 
                            value="#{mapBean.selectedPoint}" 
                            converter="omnifaces.SelectItemsConverter" 
                            scrollHeight="395" 
                            styleClass="simpleformstyle10" 
                            rendered="#{not empty mapBean.newPointsHashMap}" >

            <f:selectItems value="#{mapBean.newPointsHashMap}" />

            <p:ajax listener="#{mapBean.valueChanged}" update=":newPointsGrid:selectedPoint_grid" process="@this" />
            <f:param name="idUser" value="#{mapBean.tipTourUser.idUser}" />
        </p:selectOneListbox>
    </h:form>
    <br />
4

1 に答える 1

0

mapBean.selectedPoint をハッシュマップの最初のオブジェクトの値に設定すると、selectOneListBox がデフォルトの選択を強調表示します

于 2016-10-31T17:41:03.560 に答える