+ Start a Discussion
Sandeep M 1Sandeep M 1 

Bind datepicker value from visualforce page to controller

How to bind the datepicker value to controller. I used onfocus="DatePicker.pickDate" but it was not displaying datepicker in sandbox so i am using as below. 

<apex:page standardController="SFDC_Employee__c" extensions="payslipext" sidebar="true" showheader="true">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!SFDC_Employee__c.Month__c}"/>

<apex:outputLink value="PaySlipPage" id="page">Generate
<apex:param value="{!dateName}" /></apex:outputlink>


could any one tell me how to bind inputField value="{!SFDC_Employee__c.Month__c} in controller when Outputlink 'Generate' is clicked
Best way to find a date type variable is use <apex:inputfeld> or <apex:inputdate>

If anyway you can't use above expression then beat way is bind the date expression with String type and use Date.parse method. Alternatively you can create date by Date.newInstance(..) metohds.


So why not create object of SFDC_Employee__c in your extention and use that as bind variable ?
You can refer to that variable to capture value in the controller