View control to display document in same xpage

I am trying to have an xpage that has a view control (viewPanel1) and when I click in a document it will open the document on that same xpage using an xpage or custom control or whatever would be best.

Can someone suggest how I would do that? The document would have to be in edit mode so that I two fields could be modified.