+ Start a Discussion
dhanamjaya damaragunta 24dhanamjaya damaragunta 24 

how to get updated controller values in Java script

Hi All,
I have a scenario,I am calling controller method from JS using action function upon clicking the command button like below

<apex:commandButton value="Submit"
rendered="{!showSubmitButton}" onclick="savePartsOrderRecords();" reRender="partsOrderForm" />
Action funtion: <apex:actionFunction action="{!saveRecords}" name="savePartsOrder"/>

JS code:function savePartsOrderRecords(){

if(validateOrderParts() && validatePartsOrderTotal()){
savePartsOrder();
//alert('{!objname.status__c}');
}
}

In my controller i am updating one picklist value named as Status.if I try to get the status by using '{!objname.status__c}' in JS code (alert line)after savePartsOrder() its not giving updated value
Miles Smith 5Miles Smith 5
for me, this thread solution worked https://salesforce.stackexchange.com/questions/164931/is-there-a-way-to-call-javascript-after-action-on-visualforce-page​
with regards
shareit (https://shareit.onl/)  UC browser (https://www.ucbrowser.vip)   MX player (https://mxplayer.pro/)