+ Start a Discussion
Veeru AVeeru A 

REST Callout in Visualforce ONBLUR

I need to call an external REST service in a VF EDIT Page (I have one created from scratch...not Standard Page) and update an Inputfield. This is all to be done before a record is saved either through a button on the page or ONBLUR

I already have a functioning APEX class doing the callout if that is a better approach than doing it directly in the page. I am not sure the page will proxy out right or not or if there will be a CORS prob if its not done in the APEX Class. 

Anyway...looking for some ideas on how to best implement this. 

Thanks for any thoughts or even better short examples!! ;) 
You'll need to basically do the following:

use an Apex:actionFunction tag to wrap your apex method in a js method.
attach that newly created apex:ActionFunction as the onBlur handler for your field.