0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Visualforce] <apex:actionRegion> 使用方法

Last updated at Posted at 2022-10-19

経緯

入力内容によって後続の選択値を変えたいのに、
<apex:inputFile>タグとrerender属性の併用で発生するエラーが発生してしまった。

apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.

<apex:actionRegion>を使って対応できたので備忘録!

apex:actionRegion

apex:actionRegion:Visualforce開発者ガイドによると、
「コンポーネントを区切る領域」、rerender属性での動作制御が可能。

<div>
    種別:
        // Apexに送りたい部分だけactionRegionで囲む。inputFileは入れない
        <apex:actionRegion>
            <apex:selectList id="type_1" value="{!selectedType}" size="1">
                <apex:selectOptions value="{!types}"/>
                <apex:actionSupport event="onchange" reRender="type_2,type_3"/>
            </apex:selectList>
        </apex:actionRegion>
        <apex:selectList id="type_2" value="{!selectedType2}" size="1">
            <apex:selectOptions value="{!types2}"/>
        </apex:selectList>
        <apex:selectList id="type_3" value="{!selectedType3}" size="1">
            <apex:selectOptions value="{!types3}"/>
        </apex:selectList>
</div>

あとがき

一生初心者なのでよりよい方法があったら教えてください!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?