You need to sign in to do that
Don't have an account?

Pop up is not coming from VF page
Hi ,
My requirement is to get the pop up when i click on the enter in VF page. in the belwo code controller methos is being called, but alert pop up is not coming when i click on the enter. Code is below,
VF CODE:
<apex:page controller="bang1">
<script type="text/javascript">
function f1()
{
alert('Start invoking vf action!');
}
</script>
<apex:form >
<apex:actionFunction name="f1" action="{!m1}" />
<apex:commandButton value="enter" onclick="f1(); return false;" />
</apex:form>
</apex:page>
Apex:
Public class bang1
{
Public bang1()
{
System.debug('hiiiiiiiiiii');
}
Public void m1()
{
System.debug('hiiiiiiiiiiiiii');
}
}
Regards,
siva.
My requirement is to get the pop up when i click on the enter in VF page. in the belwo code controller methos is being called, but alert pop up is not coming when i click on the enter. Code is below,
VF CODE:
<apex:page controller="bang1">
<script type="text/javascript">
function f1()
{
alert('Start invoking vf action!');
}
</script>
<apex:form >
<apex:actionFunction name="f1" action="{!m1}" />
<apex:commandButton value="enter" onclick="f1(); return false;" />
</apex:form>
</apex:page>
Apex:
Public class bang1
{
Public bang1()
{
System.debug('hiiiiiiiiiii');
}
Public void m1()
{
System.debug('hiiiiiiiiiiiiii');
}
}
Regards,
siva.
So to achieve your requirement, you should you actionfunction name to soemthinf else that "f1" and call this in your custom JS.
Suppose your actionfunction name is P1.
<apex:actionFunction name="P1" action="{!m1}" />
Now, you can place belwo JS anywhere in page, it will work.
<script type="text/javascript">
function f1()
{
alert('Start invoking vf action!');
P1();
}
</script>
All Answers
So to achieve your requirement, you should you actionfunction name to soemthinf else that "f1" and call this in your custom JS.
Suppose your actionfunction name is P1.
<apex:actionFunction name="P1" action="{!m1}" />
Now, you can place belwo JS anywhere in page, it will work.
<script type="text/javascript">
function f1()
{
alert('Start invoking vf action!');
P1();
}
</script>
Awesome explanation it worked for me.
Thanks alot