[Salesforce]Visualforceページのinputfileとactionfunction

Visualforceページのinputfileとactionfunctionを同一Visualforcrページにて使用するときにポイント。

Visualforceページのinputfileとactionfunctionを同一Visualforceページで使う時に、以下のエラー発生する場合がある。

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

このエラーの解決策の一つとして、actionfunctionをactionregionで囲むことです。

例えば、以下の例です。

	<apex:actionRegion >
		<apex:outputPanel id="thePanel">
			<apex:actionFunction name="theActfunc" action="{!theCtlfunc}" rerender="thePanel">
    			<apex:param name="theActprm" value="" />
			</apex:actionFunction>
		</apex:outputPanel>
	</apex:actionRegion >

投稿者: kinkun

保有資格 Salesforce Certified Platform App Builder T Salesforce Certified Platform Developer I Salesforce Certified Platform Developer II Salesforce Certified Administrator

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です