Xpage - open document from ViewColumn and show in current page

One thing I’m always asked to do on our Intranet sites is to have a view down the left hand side shown like a menu and when an item is clicked show the contents down the right hand side. Over the years I’ve produce a few solutions for this but recently I’ve had a go with xpages.So I created a custom control with a viewcolumn wired to a view. Then I put this in to an Xpage that was wired to the content form. When you click on a view entry the page reloads with the content forms field show in the Xpage and the viewcolumn continues to show the view/menu. All well and good but is there any way to ‘partial postback’ the menu click so that the content field gets updated without refreshing the whole page? I’ve seen the partial postback examples around the web but the techniques shown won’t do what I want…

Ian

Subject: You’ve tried putting the view and document data sources on the same XPage, ya?

this is a markup for a XPage called ‘m01’

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>

<xp:this.data>

	<xp:dominoDocument var="document1" formName="f01"></xp:dominoDocument>

</xp:this.data>

<xp:panel style="float:left">

<xp:viewPanel rows="30" id="viewPanel1" pageName="/m01.xsp">

	<xp:this.facets>

		<xp:pager layout="Previous Group Next" xp:key="headerPager"

			id="pager1">

		</xp:pager>

	</xp:this.facets>

	<xp:this.data>

		<xp:dominoView var="v01" viewName="v01"></xp:dominoView>

	</xp:this.data>

	<xp:viewColumn columnName="Subject" id="viewColumn1"

		displayAs="link" openDocAsReadonly="true">

		<xp:viewColumnHeader value="Subject"

			id="viewColumnHeader1">

		</xp:viewColumnHeader>

	</xp:viewColumn>

	

</xp:viewPanel>

</xp:panel>

<xp:panel >

	<xp:table>

		<xp:tr>

			<xp:td>

				<xp:label value="Body:" id="body_Label1"

					for="body1">

				</xp:label>

			</xp:td>

			<xp:td>

				<xp:inputText value="#{document1.body}"

					id="body1">

				</xp:inputText>

			</xp:td>

		</xp:tr>

		<xp:tr>

			<xp:td>

				<xp:label value="Category:" id="Category_Label1"

					for="Category1">

				</xp:label>

			</xp:td>

			<xp:td>

				<xp:inputText value="#{document1.Category}"

					id="Category1">

				</xp:inputText>

			</xp:td>

		</xp:tr>

		<xp:tr>

			<xp:td>

				<xp:label value="Date:" id="Date_Label1"

					for="Date1">

				</xp:label>

			</xp:td>

			<xp:td>

				<xp:inputText value="#{document1.Date}"

					id="Date1">

				</xp:inputText>

			</xp:td>

		</xp:tr>

		<xp:tr>

			<xp:td>

				<xp:label value="Subject:" id="Subject_Label1"

					for="Subject1">

				</xp:label>

			</xp:td>

			<xp:td>

				<xp:inputText value="#{document1.Subject}"

					id="Subject1">

				</xp:inputText>

			</xp:td>

		</xp:tr>

	</xp:table>

</xp:panel>

</xp:view>

Subject: Yes!

I took your code, modified the links to match my database and yes, it works, but the whole page is being refreshed of course…I keep feeling that in the onclick event of the ViewColumn (which is where the options for partial update is) I need some code that gets the values of the fields from the selected document and then partial updates the current xpage…

Ian

Subject: For the column onclick event partial refresh a panel that contains the document?

		<xp:viewColumn columnName="Subject" id="viewColumn1">

			<xp:viewColumnHeader value="Subject" id="viewColumnHeader1">

			</xp:viewColumnHeader>

			<xp:eventHandler event="onclick" submit="true"

				refreshMode="partial" refreshId="docPanel">

				<xp:this.action>

					<xp:openPage name="/m01.xsp" target="openDocument"></xp:openPage>

				</xp:this.action>

			</xp:eventHandler>

		</xp:viewColumn>

Subject: Bit stuck!

OK - I can see how the click event is going to refresh the docPanel and that the action is to re-open the current page[xp:this.action

<xp:openPage name=“/m01.xsp” target=“openDocument”></xp:openPage>

</xp:this.action>]

But I can’t work out the docPanel - I’ve created one and assigned it the form the document was created with, but I can’t see how the document contents are displayed in the docPanel…?? At least nothing is showing when I click on the column. :frowning:

Ian

Subject: I’ll have a look at that

As soon as I get back from 4 days holiday!Thanks

Ian