h:selectOneRadioとh:selectManyCheckboxの縦並び表示

2009/06/25 18:33Update
TAGS: h:selectOneRadio | h:selectManyCheckbox | 表示 | 縦並び | タグ | ラジオボックス | チェックボックス

h:selectOneRadioとh:selectManyCheckboxの縦並び表示方法について

JSFのh:selectOneRadioラジオボックスタグとh:selectManyCheckbox多選チェックボックスデフォルトでは、横並びで表示されています。

縦並び表示したい場合、layout="pageDirection"を設定します。

例:
ラジオボックス:
<t:selectOneRadio value="#{myBean.sex}" layout="pageDirection">
    <f:selectItem itemValue="0" itemLabel="男"></f:selectItem>
    <f:selectItem itemValue="1" itemLabel="女"></f:selectItem>
</t:selectOneRadio>


チェックボックス:
<h:selectManyCheckbox value="#{myBean.sex}" layout="pageDirection">
    <f:selectItem itemValue="0" itemLabel="男"></f:selectItem>
    <f:selectItem itemValue="1" itemLabel="女"></f:selectItem>
</h:selectManyCheckbox>


ちなみに、
横並び:layout="lineDirection"
縦並び:layout="pageDirection"

有关作者
Syboos.jp編集長システム設計や開発、保守運営などを行ってます。オープンソース技術に興味があります。

Sponsored Link


Comments