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
vfDeveloper.ax341vfDeveloper.ax341 

inputField and Controller's Property

Documentation says that inputField corresponds to a field on a Salesforce object.I need the same functionality for Controller's property. So if i have property of DateTime i would like to see DatePicker, if i have property of Boolean type than checkbox etc. When i try to do this error appears: "Could not resolve the entity from <apex:inputField> value binding ('Name of controller property').
dchasmandchasman
Currently apex:inputField can only be bound to an SObject field (the component introspect's the underlying SObject field's metadata to figure things out like type and requiredness). We're working on removing this limitation - not going to make our GA release though - so here's the workaround: in your controller create a proxy instance of something that has the field types you're looking for (e.g. private Account proxy = new Account();) and expose the proxy via a property on your controller - you can then bind apex:inputField components to the properties of the proxy SObject.