0
我想要使用JavaScript的組件中的控制器的值,但我是新手,因此我不知道如何實現它。這是我的控制器類:從控制器獲取字符串值到Visual force組件
public with sharing class DragAndDropMultipleDirect
{
Public string orgID {get;set;}
Public string userID {get;set;}
Public string s3path {get;set;}
public DragAndDropMultipleDirect()
{
}
public String path()
{
String orgID = UserInfo.getOrganizationId() ;
String userID =UserInfo.getUserId();
String s3path ='string/'+orgID+'/'+userID;
system.debug('orgID ==== ??? '+s3path);
return s3path;
}
我想在組件的腳本中使用s3path的值。
<apex:component Controller="DragAndDropMultipleDirect">
<apex:attribute name="parentId" type="String" description="Parent record"/>
<Script>
function readfiles(files) {
var path = **Here I want the value of s3Path**
----- code----
}
</Script>
</apex:component>