You need to sign in to do that
Don't have an account?
sankum
how to display calender in VF page
HI to all,
Please send the code and date is created in vf page only!
A Visual Force page needs to be created. User can select any date from date picker. Default date should be today.
Assume that this is Calender, If user click on Left Arrow (<) then Previous week 7 Days will display below.
Please send the code and date is created in vf page only!
A Visual Force page needs to be created. User can select any date from date picker. Default date should be today.
Assume that this is Calender, If user click on Left Arrow (<) then Previous week 7 Days will display below.
Hope this will help ..try below code
VisualForce page code:
<pre>
<apex:page controller="PageController">
<apex:form >
<apex:inputText id="sampleDateField" value="{!sampleDateField}" onfocus="DatePicker.pickDate(true, '{!$Component.sampleDateField}', false);"/>
<c:DatePickerComponent dateFieldId="{!$Component.sampleDateField}" />
<br/>
<apex:commandButton value="Refresh" reRender="panel" action="{!refresh}"/>
</apex:form>
<apex:outputPanel id="panel">
<apex:outputText value="{!sampleDateField}"/>
</apex:outputPanel>
</apex:page>
</pre>
Controller code:
<pre>
public with sharing class PageController {
public Date sampleDateField {get; set;}
public PageReference refresh() {
return null;
}
}
</pre>
Component page code:
<pre><apex:component controller="DatePickerController">
<apex:attribute name="dateFieldId" required="true" type="String" description="id of field to set Date"/>
[
<apex:outputLink value="javascript:DatePicker.insertDate('{!currentDate}', '{!dateFieldId}', true);">{!currentDate}
</apex:outputLink>
]
</apex:component>
</pre>
Component controller code:
<pre>
public with sharing class DatePickerController {
public String currentDate{get; set;}
public DatePickerComponentController() {
currentDate = Date.Today().format();
}
}
</pre>
output:
Thanks,
Allways Cool