No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
apex:selectOptions
<apex:selectCheckBoxes>、<apex:selectRadio>、または <apex:selectList> コンポーネントに使用できる値のコレクションです。<apex:selectOptions> コンポーネントは、これらのいずれかのコンポーネントの子である必要があります。また、カスタム Visualforce コントローラの selectOption オブジェクトのコレクションにバインドされている必要があります。
このコンポーネントでは、「html-」プレフィックスを使用した HTML パススルー属性がサポートされています。パススルー属性は、<apex:selectCheckboxes> または <apex:selectRadio> 親コンポーネント内のコンポーネントに対して生成された <input> タグ、または <apex:selectList> 親コンポーネント内のコンポーネントに対して生成された <option> タグに適用されます。
例
1<!-- Page: -->
2<apex:page controller="sampleCon">
3 <apex:form>
4 <apex:selectCheckboxes value="{!countries}" title="Choose a country">
5 <apex:selectOptions value="{!items}"/>
6 </apex:selectCheckboxes><br/>
7 <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
8 </apex:form>
9 <apex:outputPanel id="out">
10 <apex:actionstatus id="status" startText="testing...">
11 <apex:facet name="stop">
12 <apex:outputPanel>
13 <p>You have selected:</p>
14 <apex:dataList value="{!countries}" var="c">a:{!c}</apex:dataList>
15 </apex:outputPanel>
16 </apex:facet>
17 </apex:actionstatus>
18 </apex:outputPanel>
19</apex:page>
20
21/*** Controller: ***/
22public class sampleCon {
23 String[] countries = new String[]{};
24
25 public PageReference test() {
26 return null;
27 }
28
29 public List<SelectOption> getItems() {
30 List<SelectOption> options = new List<SelectOption>();
31 options.add(new SelectOption('US','US'));
32 options.add(new SelectOption('CANADA','Canada'));
33 options.add(new SelectOption('MEXICO','Mexico'));
34
35 return options;
36 }
37
38 public String[] getCountries() {
39 return countries;
40 }
41
42 public void setCountries(String[] countries) {
43 this.countries = countries;
44 }
45}属性
| 属性名 | 属性型 | 説明 | 必須項目 | API バージョン | アクセス |
|---|---|---|---|---|---|
| id | String | ページの他のコンポーネントが selectOptions コンポーネントを参照できるようにする識別子。 | 10.0 | global | |
| rendered | Boolean | コンポーネントをページに表示するかどうかを指定する boolean 値。指定されていない場合、この値はデフォルトの true に設定されます。 | 10.0 | global | |
| value | Object | この selectOptions コンポーネントに関連付けられている、SelectItem 型の集合となるコントローラクラス変数を参照する差し込み項目。たとえば、コントローラクラスの関連付けられている変数の名前が mySetOfOptions である場合、value="{!mySetOfOptions}" を使用して変数を参照します。 | はい | 10.0 | global |