I am creating a VF page and want to show a custom pick list created dynamically in my controller as an inline editor for a custom value. Both the value and list are custom properties of my controller and not bound directly to any fields of an SObject.
An example of what I want is the Status field on the standard Case layout: it is displayed as a text value, but when you double-click it, a pick list is displayed as an inline editor.
Is it possible to implement the same type of an inline editor in a Visualforce page?
I know how to display a picklist using the selectList tag, but it always shows the picklist while I want it to be displayed as just a label when the inline editor is not active.
Best Answer
All you need to do is use a
apex:outputField
together with a picklist field of the selected sObject. Then the Salesforce will take care about the rest:Apex:
VF:
Update
Well, i think here you can only do some trix. Here is my thought how it could be implemented with some CSS rules only. The idea is to hide appearance of the list (down arrow) and only show it if the element gets focused. Additionaly i will add some usual SFDC styles to the element:
It looks like this then: