0
1

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ページ(JavaScriptリモーティング)

Last updated at Posted at 2017-01-24

###クライアント側JSの例

<script>
//read management for the target object
    $(function(){
        XXXXController.setObjectRead('{!Record.Id}', function (result, event){
            if(event.status){
                //success
                データは result変数に入っている
            }else if (event.type === 'exception') {
                console.log('error:' + event.message);
                console.log('where:' + event.where);
            }else{
                console.log('error:' + event.message);
            }
        });
    });
</script>

###サーバー側メソッドの例

@RemoteAction
public static void setObjectRead(String objectId){
    //update read state
    XXXXManager.setObjectReadByLoginUser(objectId);
}
@RemoteAction
@ReadOnly
public static List<String> getXXXData(){
    List<String> returnData = new List<String>();
    ・・・
    //JS側にはArrayが返る
    return returnData;
}
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?