+ Start a Discussion

Disable and enable inline editing.

I have a visual force page with inline editing enabled.  It works great when a record exists, however I can't seem to get the page to not be inline editiable when no record exists.  I've tried changing the mode to just edit or detail when no record exists but it doesn't seem to be working. 


What I would like is when the page loads, if there is a record then inline editing should be enabled, if no record exists then it shouldn't.


I have a feeling that I'm going to have to disable each individual field when no record exists.






Option 1

One solution for this is two pages - one that mimics New/Edit with entry (inputField) boxes and one that mimics View (outputField) (with inline edit). You override the New/Edit buttons to go to the first page, override the View button to go to the second page


Option 2

You could of course do this in one page with conditionally rendered page blocks.


I prefer the former option more helpful as you have more control over what you wan to expose for a new record use case versus a View record use case