You need to sign in to do that
Don't have an account?
Dipak
How to store javascript variable value in VFpage controller variable
Hi,
Can i acess java script varible value in a VF page Controller Apex class.
Suppose in my VF page , a java script variable " var a='some thing'" . Now i want to store this variable in a Apex Controller class varible...
Is it possible...?
Note that Visualforce Javascript remoting is stateless. Remoted methods must be static and remoting does not integrate w/ viewstate.
For passing Javascript values to your controller, see apex:actionFunction:
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm#kanchor858
For example:
All Answers
yes you can use java script remoting concept to send the value from page to controller or you can get the id of the component in the script and assing the value to that like
for ex:
if you have the component <apex:inputhidden value="{!hdnvalue}" id="hdnval"/>
then
<script>
var a = 'some thing';
document.getElementById.hdvbal.value = a;
</script>
Note that Visualforce Javascript remoting is stateless. Remoted methods must be static and remoting does not integrate w/ viewstate.
For passing Javascript values to your controller, see apex:actionFunction:
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm#kanchor858
For example:
Thanks a lot for your suggestion
please help ...
how to pass javascript variable in apex code....
Thanks alot in Advance
Pass the required value as parameter through javascript function ...
In below example it is "function MyMethod(id)"..From this method call a function (here it is "CallApexMethod(id)")Then program controller finds the "action function " having name "CallApexMethod(<argument>)"
<script LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
function MyMethod(id) {
CallApexMethod(id);
}
</script>
<apex:form id="PageForm">
<apex:actionFunction name="CallApexMethod" action="{!process}" oncomplete="">
<apex:param name="ID" value="" />
</apex:actionFunction>
</apex:form>
__________________________
Get the value of param "ID" in Apex controller like
String Id=System.currentPageReference().getParameters().get('ID');
Thank YOu So Much ....
It was really very HelpFul
Please help ... I am very beginner to Visual Force ...
How to sent an e-mail through apex scheduler ?? I mean to sent an e-mail at fix time.