I want to pass encodeURIComponent("{!Account.Name}");
to some apex variable.
How can I achieve this?
I will be using ecnocded value in my page.
Through the use of actionFunction
with <apex:param/>
you can pass value to the controler:
You can pass value as "{!Account.Name}"
in the javascript method.
<script type="text/javascript">
function displayFunc(value)
{
passValueToController(encodeURIComponent(value));
}
</script>
<apex:actionFunction name="passValueToController" action="{!passValue}" immediate="true" reRender="form1">
<apex:param id="selectedValue" name="selectedValue" value=""/>
</apex:actionFunction>
public void passValue()
{
fieldValue = ApexPages.currentPage().getParameters().get('selectedValue');
System.debug('fieldValue=' + fieldValue);
}
{!Account.Name}
you can directly get this value from standard controller in apex..