Some more xpage frustration or how to design an xpage view control with a computed external data source

Basically I am trying to create a picklist on an xpage to give my users the ability to search for airports worldwide and have the ICAO code returned. To keep the operative db small I decided to not have all the airport documents in the same db, but in a sort of a resource db.

Now, to provide a view in the operational database I need to connect to the resource db for the view I want to display in a view control with a wonderfully handcrafted picklist. unfortunately, once I compute the database path for the source view data I don’t have the option to pick the actual columns I want to display in the view control. Do I have to copy and customize code from a another view control in the source edit pane to have it my way? Or is there a way of creating view control columns that represent the actual columns of a view of a computed source database?

Regarding my previous problem:

My main problem was understanding that the code for picking the proper view won’t be executed on the client so I don’t have columns to pick. Which in turn forces me to copy and paste columns and adjust them to my view which in turn kind of sucks. but anyway, it works at least.

Subject: Re: View Control Pointing to computed view

Can you point it to a pecific database and set up your view control with the columns you want, then compute the path after it’s all working?

If it helps, this is the code I have for a view control picking specific columns from a database and view computed at runtime.

<xp:viewPanel id=“viewPanel1” width=“100%” rows=“9”

	var="personDoc">

	<xp:this.facets>

		<xp:pager

			layout="FirstImage PreviousImage Group NextImage LastImage"

			xp:key="headerPager" id="pager3" partialRefresh="true"

			pageCount="10" />

		<xp:pager

			layout="FirstImage PreviousImage Group NextImage LastImage" 

			xp:key="footerPager" partialRefresh="true" pageCount="10"

			id="pager1">

		</xp:pager>

	</xp:this.facets>





	<!-- Uses viewScope because we never go into the documents, will be reset if you refresh the form -->

	<xp:this.data>

		<xp:dominoView var="view1"

			viewName="#{javascript:compositeData.directoryView}"

			databaseName="#{javascript:compositeData.directoryPath}">

			<xp:this.search><![CDATA[#{javascript:var tmpArray = new Array("");

var cTerms = 0;

if (viewScope.firstNameToSearch != null && viewScope.firstNameToSearch != “”) {

tmpArray[cTerms++] = "(FIELD FirstName = \"" + viewScope.firstNameToSearch + "\")"

}

if (viewScope.lastNameToSearch != null && viewScope.lastNameToSearch != “”) {

tmpArray[cTerms++] = "(FIELD LastName = \"" + viewScope.lastNameToSearch + "\")"

}

if (viewScope.siteToSearch != null && viewScope.siteToSearch != “”) {

tmpArray[cTerms++] = "(FIELD SiteName = \"" + viewScope.siteToSearch + "\")"

}

qstring = tmpArray.join(" AND ").trim();

return qstring;}]]></xp:this.search>

		</xp:dominoView>

	</xp:this.data>



	<xp:viewColumn id="viewColumn1"

		style="width:120.0px;padding-left:0.0px;padding-right:0.0px"

		columnName="Name">



		<xp:viewColumnHeader id="viewColumnHeader1" value="Name" />

	</xp:viewColumn>

	<xp:viewColumn columnName="Extension" id="viewColumn2"

		style="width:25.0px;padding-left:0.0px;padding-right:0.0px"

		styleClass="AbstractDate">

		<xp:viewColumnHeader value="Ext" id="viewColumnHeader2"

			styleClass="AbstractDate" style="text-align:left" />

	</xp:viewColumn>

	<xp:viewColumn columnName="External No" id="viewColumn3"

		style="width:90.0px;padding-left:0.0px;padding-right:0.0px">

		<xp:viewColumnHeader value="External No"

			id="viewColumnHeader3" />

	</xp:viewColumn>

	<xp:viewColumn id="viewColumn6" columnName="Mobile No"

		style="width:90.0px;padding-left:0.0px;padding-right:0.0px">

		<xp:viewColumnHeader id="viewColumnHeader6"

			value="Mobile No" />

	</xp:viewColumn>

	<xp:viewColumn columnName="Job Description" id="viewColumn4"

		style="width:140.0px;padding-left:0.0px;padding-right:0.0px">

		<xp:viewColumnHeader value="Job Description"

			id="viewColumnHeader4" />

	</xp:viewColumn>

	<xp:viewColumn columnName="Site" id="viewColumn5"

		style="width:130.0px;padding-left:0.0px;padding-right:0.0px">

		<xp:viewColumnHeader value="Site" id="viewColumnHeader5" />

	</xp:viewColumn>

</xp:viewPanel>

Regards

Paul

Subject: thanks

Basically I’m using the same sample code for the view. But I tried to embed this custom control in a dijit dialog on another xpage. and now, if I press the search button, instead of the dialogbox the whole page gets refreshed, although I picked partial refresh and gave the id of the item to refresh.

refreshing the whole page makes the dialog disappear again and i have to bring it up again by invoking the button for showing up the dialog again. how do i effect a search on a view thats withing a dijit dialog and still make the dialog be visible after the search?

Regarding the previous problem:

My main problem was that I wasn’t aware that the code for the selection of the view doesn’t get executed on the client, therefore nor columns to pick, and you have to write the code for the columns all by yourself or copy it from somewhere and adjust it. Pretty lame.