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

Filpping between View and Edit for a list of records on a VF page

I've got a nice S-Control that lets me see all my time entries for the week on one page. I see a view of the data and if I hit the edit button on an entry, I flip to an edit form.

I want to rebuild this in VisualForce and I'm struggling around how to produce that pattern.

In JS I had a Div with the HTML for displaying the record, and when I hit the edit button, I replaced the complete contents of the DIV with an edit form. On save, I replace the contents again, back to the view HTML.

If I'm displaying a list of entries in VF, I can easily display them as outputText or inputFields. And I know how to rerender elements. But any ideas on the best way to flip between view and edit modes?


I think you can create a VF  page for the view page and then create some command button that navigates to edit page .
This command button will have the action method which takes to edit page by creating a pagereference.

Is that what u r looking for ?


No, I'm looking to do "inline" editing for a list of records on one page. Here's my S-Control:

You'll see the top entry is in edit mode, while the other entries are in view mode.


I am trying to do the same thing with the list I have?

I am able to add, but I am not able to edit list ? can you give any suggestions How you implemented, list and inline editing/