0
2

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 5 years have passed since last update.

VFページ(Action Function)

Last updated at Posted at 2017-01-24

VFページ側のAction Functionの例

パラメータを送信することも可能
name=>サーバーコール用のJS関数名
action=>サーバー側メソッド名
reRender=>サーバーコール後に再描画するノードのId

<apex:form">
  <apex:actionFunction name="updateXXXItem" action="{!updateXXXItem}" reRender="ChatterFeedsArea, xxx" >
    <!-- パラメータはオプション -->
    <apex:param name="feedItemId" value="" />
  </apex:actionFunction>
  <script>
        function doUpdateFeedItem(xxxItemId){
            updateXXXItem(xxxItemId);
        }
  </script>
</apex:form>
...
<apex:outputPanel id="ChatterFeedsArea">
...

サーバー側メソッドの例

送信したパラメータはgetParametersで受け取る

/*
 * update XXXItem
 * (action function)
 */
public void updateXXXItem() {
    String XXXItemId = Apexpages.currentPage().getParameters().get('XXXItemId');
    XXXHelper.updateXXXItem(xxxItemId, MessageBody, vRecordId);
    XXXItems = null;
} 

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?