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

apex:action function problem
Hey,
I am using apex:action 2 times. it is calling wrong action function everytime.
Here is the code
here, when i click on punchin, it is calling punchout apex:actionfunction instead of punchin. i tried pageblock, apex:region , but everytime it is calling wrong method. please help me out here.
Thanks
I am using apex:action 2 times. it is calling wrong action function everytime.
Here is the code
<apex:page standardController="Project__c" sidebar="false" showHeader="true" extensions="test3"> <apex:includeScript value="{!$Resource.modernizr}"/> <script> function doTheGeoThang() { if (Modernizr.geolocation){ navigator.geolocation.getCurrentPosition( function(position) { findMe(position.coords.latitude,position.coords.longitude); } ); } else { alert ("Your browser isn't hit. Upgrade man!"); } } </script> <apex:form > <apex:pageBlock > <apex:actionRegion ><b><span style="cursor: pointer;" onclick="doTheGeoThang()"> <center>Punch In</center> </span> </b><br/><br/> <apex:actionFunction name="findMe" action="{!PunchIn}" rerender="jsvalues"> <apex:param name="lat" value="" assignTo="{!valueLat}"/> <apex:param name="long" value="" assignTo="{!valueLong}"/> </apex:actionFunction></apex:actionRegion> </apex:pageBlock></apex:form> <apex:form ><apex:actionRegion > <b><span style="cursor: pointer;" onclick="doTheGeoThang()"> <center>Punch Out</center> </span> </b><br/><br/> <apex:actionFunction name="findMe" action="{!PunchOut}" rerender="jsvalues"> <apex:param name="lat" value="" assignTo="{!valueLat}"/> <apex:param name="long" value="" assignTo="{!valueLong}"/> </apex:actionFunction></apex:actionRegion> </apex:form> </apex:page>
here, when i click on punchin, it is calling punchout apex:actionfunction instead of punchin. i tried pageblock, apex:region , but everytime it is calling wrong method. please help me out here.
Thanks

your both action functions have the same name findMe give different names to two functions and call the correct function by name