visualforceでapexカスタムコントローラークラスから配列を返し、JavaScriptでその配列を使用したいと思います。
私のやり方:
Javascript:
var SFObjectArray;
function myJavascriptMethod()
{
SFObjectArray = myArrayItems();
}
Apex:
<apex:actionFunction name="myArrayItems"
action="{!myArrayItems}"
status="mystatus"
reRender="out"/>
</apex:actionFunction>
Controller:
public class MyController
{
String[] arrayItems;
public PageReference myArrayItems()
{
arrayItems = new String[]{'abc','def'};
return null;
}
public String[] getItems()
{
return arrayItems ;
}
}
誰かが私にいくつかの助けを提供できますか?