+ Start a Discussion
Nikunj VNikunj V 

command button not excuting function

hello,


commandbutton with action function isn't working for punch in on line 32, but same kind of functionality is working on line 43. can anyone point out what is wrong?
<apex:page standardController="Project__c" sidebar="false" showHeader="true" extensions="ProjectTime_Controller">

<apex:includeScript value="{!$Resource.modernizr}"/>

<script>
function doTheGeoThang() {
if (Modernizr.geolocation){
navigator.geolocation.getCurrentPosition(
function(position) {
findMe2(position.coords.latitude,position.coords.longitude);
}
);
} else {
alert ("Your browser isn't hit. Upgrade man!");
}
}
function doTheGeoThang3() {
if (Modernizr.geolocation){
navigator.geolocation.getCurrentPosition(
function(position) {
findMe3(position.coords.latitude,position.coords.longitude);
}
);
} else {
alert ("Your browser isn't hit. Upgrade man!");
}
}
</script>

<apex:form >
<apex:pageBlock ><apex:pageblockSection >
<apex:commandButton value="Punch In" onclick="doTheGeoThang();"/><br/><br/>
<apex:actionFunction name="findMe2" action="{!PunchIn}" rerender="jsvalues">
<apex:param name="lat" value="" assignTo="{!valueLat}"/>
<apex:param name="long" value="" assignTo="{!valueLong}"/>
</apex:actionFunction></apex:pageblockSection>
</apex:pageBlock></apex:form>


<apex:form ><apex:actionRegion >
<b><span style="cursor: pointer;"
onclick="doTheGeoThang3()">
<center>Punch Out</center>
</span>


</b><br/><br/>
<apex:actionFunction name="findMe3" 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>

 
surasura
line 43 is inside a <apex:actionregion> and 32  is not , try putting action region around 32 also
Nikunj VNikunj V
That is not the problem.  i changed the code as you suggested in last answer:
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BMViIAO


i want to try command button instead of normal text. 
i also tried.l actionregion. it isnt working.
Thanks
Amit Chaudhary 8Amit Chaudhary 8
Hi Nikunj Vadi 2,

Please try to add reRender in Command Button at line number 32

Thanks
Amit Chaudhary