function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MukulMukul 

Calander Widget on VF Page

Hi all,

 

I have a custom input field called Start Date and i want to use a calander widget on it.

 

Any pointers on how to do that in Visualforce?

 

Here is where i would want to attach it...Any help is much appreciated!

 

 

<apex:pageBlockSectionItem > <apex:outputLabel value="Start date(YYYY-MM-DD):" for="startDate"/> <apex:outputPanel layout="block" styleClass="requiredInput"> <apex:outputPanel layout="block" styleClass="requiredBlock"/> <apex:inputText value="{!startDate}" id="startDate" required="true"/> </apex:outputPanel> </apex:pageBlockSectionItem>

 

 Thanks!

Mukul

 

Best Answer chosen by Admin (Salesforce Developers) 
Ron HessRon Hess

still, all you need is a controller property getter/setter that points to an sobject that has a date field contained in it.

 

 

 

public Task mytask { get; set; }{ mytask = new Task(); }

 

then in your page use the task activityDate to show the user the required UI

 

 

<apex:inputField value="{!mytask.activityDate}" />

 

 

 

 

 

All Answers

Ron HessRon Hess
try using  apex : inputField
MukulMukul

Hi Ron,

 

I am not using an object's field for this. It is just on my form as a control.

 

Regards

Mukul

Ron HessRon Hess

still, all you need is a controller property getter/setter that points to an sobject that has a date field contained in it.

 

 

 

public Task mytask { get; set; }{ mytask = new Task(); }

 

then in your page use the task activityDate to show the user the required UI

 

 

<apex:inputField value="{!mytask.activityDate}" />

 

 

 

 

 

This was selected as the best answer
MukulMukul

Thanks Ron! That worked..

 

Can i do something similar to get a look up window like we get in advanced filters in Reports tab when we choose a picklist like industry or rating?

 

Regards

Mukul