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

command button functionality issue
hey,
i am having problem calling the fuction from controller and script using actionfunction. if i am using command button without actionfunction, everything is working fine. but with actionfuction nothing is getting executed .
Code
thanks
i am having problem calling the fuction from controller and script using actionfunction. if i am using command button without actionfunction, everything is working fine. but with actionfuction nothing is getting executed .
Code
<apex:page standardController="Project_Time__c" extensions="SwitchProject_Controller"> <apex:includeScript value="{!$Resource.modernizr}"/> <script> function doTheGeoThang() { if (Modernizr.geolocation){ navigator.geolocation.getCurrentPosition( function(position) { loc(position.coords.latitude,position.coords.longitude); } ); } else { alert ("Your browser isn't hit. Upgrade man!"); } } </script> <apex:form > <apex:pageblock > <apex:pageBlockSection title="Switch Project" columns="1"> <apex:actionregion > <apex:commandButton onclick="doTheGeoThang();" value="Switch Project"/><br/> <apex:actionFunction name="loc" action="{!SwitchProject}" rerender="jsvalues"> <apex:param name="lat" value="" assignTo="{!valueLat}"/> <apex:param name="long" value="" assignTo="{!valueLong}"/> </apex:actionFunction> </apex:actionregion> <apex:inputField value="{!Project_Time__c.Project__c}" /> </apex:pageBlockSection> </apex:pageblock> </apex:form> </apex:page>
thanks
As per your code your are reRender "jsvalues" and I didn't see any apex tag with "jsvalues" id.
FYI:
- As you are using "actionRegion" tag, Please take care of The "jsvalues" id Tag should be wrapped in <apex:actionRegion> tag.
Hope its help!!
Thanks!
this code is working :
but above isn't . why?
salesforce use the Id specified in reRender attaribute use for Render that tag once AJAX request is completed, so when you are not specified Id salesforce render nothing.
Hope its clear your question.
Please mark as best answer if its resolved your issue. Its help other if they surve same problem.
Thanks!