ExtLib - XPage Search Results Sample Solution

Mindwatering Incorporated

Author: Tripp W Black

Created: 05/04/2011 at 04:35 PM

 

Category:
Notes Developer Tips
XPages

The Extension Library donated by IBM is very cool. It exposes a lot of the DOJO controls and includes a decent application layout control to jump start development.
However, the search results page is not done. Here is what we did with that page:


<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">

<xc:OneUILayout navigationPath="/OneUI/SearchPage">
<xp:this.facets>
<xp:panel xp:key="LeftColumn" id="panel4">
<xc:LeftMain></xc:LeftMain>
</xp:panel>
</xp:this.facets>
<xp:panel>

<xp:label value="Selected Option:" id="label2" rendered="false"></xp:label>
<xp:inputText id="inputText2" value="#{param.option}" rendered="false"></xp:inputText>
<xp:br></xp:br>
<xp:label value="Search String: " id="label1"></xp:label>
&#160;<xp:inputText id="inputText1" value="#{param.search}"></xp:inputText>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:label value="Results:" id="label5"
style="font-weight:bold">
</xp:label>
<xp:viewPanel rows="10" id="viewPanel1"
pageName="/pgViewNLDoc.xsp">
<xp:this.facets>
<xp:panel xp:key="headerPager" id="panel2">
<xe:pagerExpand id="pagerExpand1"
for="viewPanel1">
</xe:pagerExpand>
<xp:pager partialRefresh="true"
layout="Previous Group Next" id="pager1">
</xp:pager>
</xp:panel>
<xp:panel xp:key="footerPager" id="panel3">
<xe:pagerSizes id="pagerSizes1" for="viewPanel1">
</xe:pagerSizes>
</xp:panel>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1" viewName="navInstType"
expandLevel="1">
<xp:this.search><![CDATA[#{javascript:var srchtyp = param.option;
var srchstr = param.search;
var srchskip = '';

if(srchtyp = 'c1') {
// instrument cat field search
"FIELD NL_InstType CONTAINS " + srchstr
} else if(srchtyp = 'c2') {
// name field search
"FIELD NL_Name CONTAINS " + srchstr
} else if(srchtyp = 'c0') {
// wildcard search, just search phrase entered
srchstr;
} else {
// invalid
srchskip;
}}]]></xp:this.search>
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="NL_InstType" id="viewColumn1"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Instrument Type"
id="viewColumnHeader1">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_InstSubType" id="viewColumn2"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Inst. Sub Type"
id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_BankType" id="viewColumn3"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Bank Type"
id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_Bank" id="viewColumn4"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Bank Name"
id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_BankSubType" id="viewColumn5"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Bank Sub Type"
id="viewColumnHeader5">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_Number" id="viewColumn6"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Number"
id="viewColumnHeader6">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_Name" id="viewColumn7"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Name"
id="viewColumnHeader7">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_KeyMake" id="viewColumn8"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Make"
id="viewColumnHeader8">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="NL_KeyModel" id="viewColumn9"
displayAs="link" indentResponses="true">
<xp:viewColumnHeader value="Model"
id="viewColumnHeader9">
</xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel>
</xp:panel>
</xc:OneUILayout>
</xp:view>

previous page