Parameter passing using Javascript+actionFunction in visualforce

In visualforce, there is a method for passing parameters from visualforce page to controller using javascript and actionFunction. Here is the example;

/*JavaScript*/
<script type="text/javascript">
function doSave(date) {
paraFunction(document.getElementById(date).value);
}
</script>

/*Action Function*/
<apex:actionFunction name="paraFunction" action="{!saveInterviewDate}" rerender="view">     
<apex:param id="aname" name="interviewDate" value="" />
</apex:actionFunction>

/*Call the javaScript from here*/
<apex:commandLink onclick="doSave('{!$Component.interviewDate}');">               
<apex:commandButton value="Save"/>
</apex:commandLink>

/*get the parameter in controller*/
String interviewdate=Apexpages.currentPage().getParameters().get('interviewDate');

Comments

  1. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
    Vee Eee Technologies

    ReplyDelete
  2. Very helpful link.. Thank you for sharing it!

    ReplyDelete
  3. Nice post...I look forward to reading more, and getting a more active part in the talks here, whilst picking up some knowledge as well..

    Pass Box manufacturers

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. • Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating mulesoft Online Training
    "

    ReplyDelete
  6. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingmulesoft online training

    ReplyDelete
  7. Hi , thanks for sharing your information.The insights are really helpful and informative.
    IOT training coimbatore
    Robotics in Coimbatore

    ReplyDelete


  8. Python Training in ChennaiLearn Python Training in Chennai from industry experts and become a python certified professional.BITA is the Best Python Training Institute in Chennai which is located in ramapuram. Call for more details.

    ReplyDelete
  9. Nice Information
    We are the best piping design course in Hyderabad, India. Sanjary academy Offers Piping Design Course and Best Piping Design Training Institute in Hyderabad. Piping Design Institute in India Piping Design Engineering.
    Piping Design Course
    Piping Design Course in india
    Piping Design Course in hyderabad

    ReplyDelete
  10. Thanks for sharing information
    Sanjary kids is the best playschool, preschool in Hyderabad, India. Start your play school,preschool in Hyderabad with sanjary kids. Sanjary kids provides programs like Play group,Nursery,Junior KG,Serior KG,and Teacher Training Program.
    play school in hyderabad
    Preschool in hyderabad
    Preschool teacher training course in hyderabad
    pre and primary teacher training course in hyderabad

    ReplyDelete
  11. Nice Information
    We are the best piping design course in Hyderabad, India. Sanjary academy Offers Piping Design Course and Best Piping Design Training Institute in Hyderabad. Piping Design Institute in India Piping Design Engineering.
    Piping Design Course
    Piping Design Course in india
    Piping Design Course in hyderabad

    ReplyDelete
  12. Thanks for sharing
    Sanjary kids is the best playschool, preschool in Hyderabad, India. Start your play school,preschool in Hyderabad with sanjary kids. Sanjary kids provides programs like Play group,Nursery,Junior KG,Serior KG,and Teacher Training Program.
    play school in hyderabad
    Preschool in hyderabad
    Preschool teacher training course in hyderabad
    pre and primary teacher training course in hyderabad

    ReplyDelete
  13. I am so proud of you and your efforts and work make me realize that anything can be
    done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt. Here is i want to share about mulesoft training online with Free Bundle videos .


    ReplyDelete

Post a Comment

Popular posts from this blog

Displaying pop-up summaries on hover in visualforce