2

I was wondering, In a RemoteAction function in an apex class can or should this be able to access the current force.com site page? I would like to access and write to cookie parameters from within my static remote method but I'm guessing this may not be possible? If not, any suggestions on how to get around this would be useful.

Thanks in advance.

4

1 回答 1

2

远程操作方法在异步模式下运行。因此,从 url 参数访问值将为您获取空值。如果您的 apex 类需要任何静态值来处理,请使用参数。使用参数从页面传递到您的 apex 方法。

我最近发现有一种方法可以做到这一点

使用 {!$currentpage.parameters.something} 从页面上的脚本传递它们

您仍然需要检查代码中的空值,因为它可能合法地为空

于 2013-04-11T01:48:42.080 回答