Pager save state - xpages

I am using this Ext Lib (8.5.2) custom controls viewpanel, pager save state and dyanmic content. Does pager save state works with View panel.
If yes, pls look at my code here. I do not know why it is not working.
I am in the learning curve of xpages.
Thank you in advance.
Jason
This my custom control
<xe:pagerSaveState id="pagerSaveState1" globalRows="true"
for="viewPanel1">
</xe:pagerSaveState>
<xp:this.resources>
<xp:styleSheet href="/tablelayout.css"></xp:styleSheet>
</xp:this.resources>
<xe:dynamicContent id="dynContent" defaultFacet="viewpnl"
useHash="true">
<xe:this.facets>
<xp:panel xp:key="viewpnl" id="viewpnl">
<xp:viewPanel rows="30" id="viewPanel1" var="rowData"
columnClasses="evencol,oddcol" rowClasses="evenrow,oddrow"
binding="#{javascript:viewStateBean.restoreState}">
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="headerPager" id="pager1">
</xp:pager>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1"
categoryFilter="#{javascript:sessionScope.searchValue}"
expandLevel="1" viewName="#{javascript:viewScope.vName}">
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="Urgency" id="viewColumn1"
expandedImage="/Collapse+Icon" collapsedImage="/Expand+Icon">
<xp:viewColumnHeader value="Urgency" id="viewColumnHeader1">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="From1" id="viewColumn2"
displayAs="link">
<xp:viewColumnHeader value="From" id="viewColumnHeader2">
</xp:viewColumnHeader>
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:executeScript
script="#{javascript:viewScope.docUnid = rowData.getNoteID();}">
</xp:executeScript>
<xe:changeDynamicContentAction
facetName="form1" for="dynContent">
</xe:changeDynamicContentAction>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:viewColumn>
<xp:viewColumn columnName="SubDateTime" id="viewColumn3">
<xp:this.converter>
<xp:convertDateTime type="both" timeStyle="short">
</xp:convertDateTime>
</xp:this.converter>
<xp:viewColumnHeader value="Time of Call" id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Category" id="viewColumn4">
<xp:viewColumnHeader value="Category" id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="JobStatus" id="viewColumn5">
<xp:viewColumnHeader value="Status" id="viewColumnHeader5">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn id="viewColumn6">
<xp:this.value><![CDATA[#{javascript:if (rowData.isCategory()){return rowData.getColumnValue("Total")
}}]]></xp:this.value>
<xp:this.converter>
<xp:convertNumber type="number" integerOnly="true">
</xp:convertNumber>
</xp:this.converter>
<xp:viewColumnHeader id="viewColumnHeader6"
value="Total">
</xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel>
</xp:panel>
<xc:xp_serviceRequestform xp:key="form1"></xc:xp_serviceRequestform>
</xe:this.facets>
</xe:dynamicContent>
This is the form cancel button
<xp:button value="Cancel" id="cancelbut">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete" immediate="true" save="false">
<xp:this.action>
<xp:actionGroup>
<xe:changeDynamicContentAction
facetName="viewpnl" for="dynContent">
</xe:changeDynamicContentAction>
<xp:executeScript
script="#{javascript:viewStateBean.restoreState = true}">
</xp:executeScript>
</xp:actionGroup>
</xp:this.action></xp:eventHandler>

Related

Can't edit a document launched from a view in a dialog control in xpages

I have an XPages view with the first column as a link to launch the document for that row. I'm launching it in a dialog control and it works just fine, but it won't let me edit the document. I have an edit button on the dialog control to put it in edit mode, but it doesn't seem to work.
There are two datasources, one for the view and one for the document.
XPage:
<?xml version="1.0" encoding="UTF-8"?>
<xc:NewMainForm><xp:this.facets><xc:NewLogin xp:key="facet_Login "></xc:NewLogin>
<xc:FooterContent xp:key="facet_Footer"></xc:FooterContent>
<xc:HomeBodyContent xp:key="facet_Body"></xc:HomeBodyContent>
<xc:MenuContainer xp:key="facet_Menu"></xc:MenuContainer>
<xc:cc_headerRightContent xp:key="facet_HeaderRight">
</xc:cc_headerRightContent>
<xc:cc_headerCenterContent xp:key="facet_HeaderCenter">
</xc:cc_headerCenterContent>
<xc:cc_headerLeftContent xp:key="facet_HeaderLeft">
</xc:cc_headerLeftContent>
<xc:NewLogin xp:key="facet_Login"></xc:NewLogin></xp:this.facets>
</xc:NewMainForm></xp:view>
Custom Control:
<?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"
style="background-repeat:no-repeat;background-position:center center"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.resources>
<xp:script src="/xspDialog.js" clientSide="true"></xp:script>
<xp:styleSheet href="/Style.css"></xp:styleSheet>
</xp:this.resources>
<xp:panel>
<xp:inputText id="Search" value="#{viewScope.searchString}">
</xp:inputText>
<xp:button value="Search" id="button1"
style="background-color:rgb(57,88,137);color:rgb(255,255,255)">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="viewPanel1">
</xp:eventHandler>
</xp:button>
</xp:panel>
<!-- VIEW PANEL -->
<xp:viewPanel id="viewPanel1" pageName="/ByAcronym.xsp"
viewStyle="width:100%;background-
image:url(Music1+Big+twice+Faded.png);background-repeat:no-
repeat;background-position:center center;border-width:thick"
var="thisentry" rows="27">
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="headerPager" id="pager1">
</xp:pager>
<xp:viewTitle xp:key="viewTitle" id="viewTitle1"
value="By Title" style="color:rgb(255,128,0);font-weight:bold">
</xp:viewTitle>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="footerPager" id="pager2">
</xp:pager>
</xp:this.facets>
<xp:this.data>
<xp:dominoView viewName="Songs" var="dsSongs"
ignoreRequestParams="true">
<xp:this.search><![CDATA[#{javascript:return
viewScope.get("searchString")}]]></xp:this.search>
</xp:dominoView>
</xp:this.data>
<!-- VIEWCOLUMN1 -->
<xp:viewColumn columnName="Title" id="viewColumn1"
displayAs="link" style="width: 750px">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="dialog1" id="eventHandler1">
<xp:this.action>
<![CDATA[#{javascript:viewScope.UNID =
thisentry.getDocument().getUniversalID();
getComponent('dialog1').show()}]]>
</xp:this.action>
</xp:eventHandler>
<xp:viewColumnHeader value="Title" id="viewColumnHeader1">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="MusicType" id="viewColumn2">
<xp:viewColumnHeader value="Music Type"
style="width: 250px" id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="ComposedBy" id="viewColumn3">
<xp:viewColumnHeader value="Composer"
id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="ArrangedBy"
id="viewColumn4">
<xp:viewColumnHeader value="Arranger"
id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Jonra" id="viewColumn5">
<xp:viewColumnHeader value="Jonra"
id="viewColumnHeader5">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Seasonal" id="viewColumn6">
<xp:viewColumnHeader value="Seasonal"
id="viewColumnHeader6">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn id="viewColumn7" columnName="Location"
style="width:75px">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header"
id="viewColumnHeader7" value="Location" style="width:750px">
</xp:viewColumnHeader>
</xp:this.facets>
</xp:viewColumn>
<xp:viewColumn id="viewColumn8" columnName="NumberOfCopies"
style="width:10.0px">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header"
id="viewColumnHeader8" value="Number Of Copies"
style="width:750px">
</xp:viewColumnHeader>
</xp:this.facets>
</xp:viewColumn>
</xp:viewPanel>
<!-- DIALOG1-->
<xe:dialog id="dialog1" title="Details">
<xe:dialogContent id="dialogContent1">
<xp:panel
style="width:698.0px;background-
image:url(Music1+Big+twice+Faded.png);background-repeat:no-
repeat;background-position:center center;border-
color:rgb(57,88,137);border-style:solid;border-
width:thin;color:rgb(33,51,80)">
<xp:this.data>
<xp:dominoDocument var="document1"
formName="MusicForm" action="editDocument"
documentId="#{javascript:viewScope.UNID}"
ignoreRequestParams="true">
</xp:dominoDocument>
</xp:this.data>
<xp:table>
<xp:tr>
<xp:td>
<xp:label value="Music Type:"
id="musicType_Label1" for="musicType1"
style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.MusicType}"
id="musicType1">
</xp:inputText>
</xp:td>
<xp:td>
<xp:label value="Title:" id="title_Label1"
for="title1" style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.Title}"
id="title1">
</xp:inputText>
</xp:td>
<xp:td>
<xp:label value="Composed By:"
id="composedBy_Label1" for="composedBy1"
style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.ComposedBy}"
id="composedBy1">
</xp:inputText>
</xp:td>
<xp:td>
<xp:label value="Arranged By:"
id="arrangedBy_Label1" for="arrangedBy1"
style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.ArrangedBy}"
id="arrangedBy1">
</xp:inputText>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label value="Jonra:" id="jonra_Label1"
for="jonra1" style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.Jonra}"
id="jonra1">
</xp:inputText>
</xp:td>
<xp:td>
<xp:label value="Season:"
id="seasonal_Label1" for="seasonal1"
style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.Seasonal}"
id="seasonal1">
</xp:inputText>
</xp:td>
<xp:td>
<xp:label value="Location:"
id="location_Label1" for="location1"
style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText value="#{document1.Location}"
id="location1">
</xp:inputText>
</xp:td>
<xp:td>
<xp:label value="Number Of Copies:"
id="numberOfCopies_Label1" for="numberOfCopies1"
style="font-weight:bold">
</xp:label>
<xp:br></xp:br>
<xp:inputText
value="#{document1.NumberOfCopies}"
id="numberOfCopies1">
</xp:inputText>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td colspan="4">
<xp:messages layout="table"
style="color:red" id="messages1">
</xp:messages>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td colspan="4">
<xp:button id="button5" value="Save">
<xp:this.rendered><![CDATA[#
{javascript:if(document1.isNewNote()){
false
}else{
true
}}]]></xp:this.rendered>
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete"
id="eventHandler5">
<xp:this.action>
<xp:actionGroup>
<xp:executeScript
script="#
{javascript:document1.save()}">
</xp:executeScript>
<xp:openPage
name="/Main.xsp">
</xp:openPage>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button id="button4" value="Submit">
<xp:this.rendered><![CDATA[#
{javascript:if(document1.isNewNote()){
true
}else{
false
}}]]></xp:this.rendered>
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete"
immediate="false"
save="true" id="eventHandler2">
<xp:this.action>
<xp:actionGroup>
<xp:openPage
name="/Main.xsp">
</xp:openPage>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button value="Edit" id="button2"
rendered="#
{javascript:!document1.isEditable()}">
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete"
id="eventHandler3">
<xp:this.action>
<xp:changeDocumentMode
mode="edit" var="document1">
</xp:changeDocumentMode>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button id="button3">
<xp:this.value><![CDATA[#
{javascript:if(document1.isEditable()){
"Cancel"
}else{
"Close"
}}]]></xp:this.value>
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete"
immediate="true"
save="false" id="eventHandler4">
<xp:this.action>
<xp:openPage name="/Main.xsp">
</xp:openPage>
</xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:td>
</xp:tr>
</xp:table>
</xp:panel>
</xe:dialogContent>
</xe:dialog>
</xp:view>
What am I doing wrong?
MJ
"Maximum Internet name and password" on the ACL's Advanced tab can limit access. If that's set to e.g. Reader, the highest access permitted for the application on the web will be Reader access, regardless of the individual's ACL settings. Author would only allow them to create, not edit existing documents that do not have an Authors field etc.

viewPanel.getSelectedIds returns 0

I have a button which should change the value of a field on the selected documents from a viewpanel. But whatever I do, I also switched the columns where the checkbox was, I always get 0 ids.
Here is my viewPanel:
<xp:viewPanel rows="30" id="viewPanel1" pageName="/Account.xsp" var="rowData">
<xp:this.facets>
<xp:pager partialRefresh="true"
layout="FirstImage PreviousImage SeparatorPage Group NextImage LastImage"
xp:key="headerPager" id="pager1" alwaysCalculateLast="true">
</xp:pager>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1" viewName="Konten\Fehler">
<xp:this.search><![CDATA[#{javascript:return viewScope.get( "searchString" );}]]></xp:this.search>
</xp:dominoView>
</xp:this.data>
<xp:viewColumn id="viewColumn10" columnName="$errCodes">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header" id="viewColumnHeader10" value="Fehler">
</xp:viewColumnHeader>
</xp:this.facets>
</xp:viewColumn>
<xp:viewColumn id="viewColumn9" styleClass="total">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header" id="viewColumnHeader9">
</xp:viewColumnHeader>
</xp:this.facets>
<xp:this.value><![CDATA[#{javascript:if( rowData.isCategory() )
{
return rowData.getColumnValue( "$11" )
}}]]></xp:this.value>
<xp:this.converter>
<xp:convertNumber type="number" integerOnly="true">
</xp:convertNumber>
</xp:this.converter>
</xp:viewColumn>
<xp:viewColumn id="viewColumn8" columnName="accountnumber" displayAs="link">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header" id="viewColumnHeader8" value="Konto" sortable="true">
</xp:viewColumnHeader>
</xp:this.facets>
</xp:viewColumn>
<xp:viewColumn columnName="iban" id="viewColumn1" showCheckbox="true">
<xp:viewColumnHeader value="IBAN" id="viewColumnHeader1" sortable="true">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="accounttype" id="viewColumn2">
<xp:viewColumnHeader value="Typ" id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn id="viewColumn7" columnName="$info">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header" id="viewColumnHeader7" value="Fehlermeldung" sortable="true">
</xp:viewColumnHeader>
</xp:this.facets>
</xp:viewColumn>
</xp:viewPanel>
and the button
<xp:button value="Ausblenden" id="button1" styleClass="btn-info">
<xp:eventHandler event="onclick" submit="true" refreshMode="norefresh">
<xp:this.action>
<![CDATA[#{javascript:
var viewPanel = getComponent( "viewPanel1" );
var docIDArray = viewPanel.getSelectedIds();
for( i=0; i < docIDArray.length; i++ )
{
var docId = docIDArray[i];
var doc:NotesDocument = database.getDocumentByID( docId );
doc.replaceItemValue( "$shErr", 0 );
doc.save();
}
}]]>
</xp:this.action>
</xp:eventHandler>
</xp:button>
but somehow getSelectedIds returns no id at all.
Any ideas? Thanks for your time!
If you try the below, do you get anything from unidArray?
var unidArray = new Array();
for(i=0; i < docIDArray.length; i++) {
var unid=database.getDocumentByID(docIDArray[i]).getUniversalID();
unidArray.push(unid);
}

xpages viewpanel pager combined with search not defaulting to the first page once user used the pager to navigate to the second,third,fourth etc. page

I have a viewpanel that I am using the "Search in view results" feature. The view has a pager. The scoped variable that I use for the search is null initially and the user has an option to choose from a list to create a search. The initial null search brings back about 1000 records and the user can use a page selector to scroll through the entries if they wish. If the user chooses say page 5 and then creates a search, the pager headers show up but no search results. In order to see the search results the user has to manually click on "first", then the pager resets and the results of the search appear.
I saw a solution in ViewPanel filter by StartKeys...but pager don't Update. However, I cannot use getAllEntriesByKey because I am returning the results of a search not a filter.
Here is the code, stripped down to the basics. In my application the user can create a search with up to 4 terms.
Thanks,
---Lisa&
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:table>
<xp:tr>
<xp:td><xp:comboBox id="TeacherComboBox" value="#{viewScope.TeacherComboBox}">
<xp:selectItems id="selectItems9">
<xp:this.value><![CDATA[#{javascript:return ""}]]></xp:this.value>
</xp:selectItems>
<xp:selectItems id="selectItems10">
<xp:this.value><![CDATA[#{javascript:var dbName = session.getCurrentDatabase();
var view = ("CampusCodes");
var CampusList = #Unique(#DbColumn(dbName,view,1));
return CampusList}]]></xp:this.value>
</xp:selectItems>
</xp:comboBox></xp:td>
</xp:tr>
<xp:tr>
<xp:td><xp:button id="button14" styleClass="BlueButtonSmall" value="Apply Search">
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete" id="eventHandler17">
<xp:this.action><![CDATA[#{javascript:viewScope.TeacherSearchFormula = null;
var TeacherSearchFormula = null;
var Campus = null;
if (!!viewScope.TeacherComboBox) {
Campus = '[CampusNum]' + ' CONTAINS ' + viewScope.TeacherComboBox;
};
if (!!Campus) {
TeacherSearchFormula = Campus;
};
if (!!TeacherSearchFormula) {
viewScope.TeacherSearchFormula = TeacherSearchFormula;
print("viewScope.TeacherSearchFormula = ",viewScope.TeacherSearchFormula);
viewScope.ErrorLabel4T = "Search did not return any teachers.";
} else {
var varAlert = "Please choose some filters."
var al = "alert('"+ varAlert +"')";
view.postScript(al);
}}]]></xp:this.action>
</xp:eventHandler>
</xp:button><xp:button id="button15" styleClass="BlueButtonSmall" value="Clear Search">
<xp:eventHandler event="onclick"
submit="true" refreshMode="complete" id="eventHandler19">
<xp:this.action><![CDATA[#{javascript:getComponent("TeacherComboBox").setValue("");
viewScope.TeacherSearchFormula = null;
viewScope.TeacherComboBox = null;
}]]></xp:this.action>
</xp:eventHandler>
</xp:button></xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:viewPanel rows="30" id="viewPanel1">
<xp:this.facets>
<xp:pager xp:key="headerPager" id="pager1"
for="viewPanel1" partialRefresh="true">
<xp:pagerControl type="First"
id="pagerControl1">
</xp:pagerControl>
<xp:pagerControl type="Next"
id="pagerControl2">
</xp:pagerControl>
<xp:pagerControl type="Group"
id="pagerControl3">
</xp:pagerControl>
<xp:pagerControl type="Previous"
id="pagerControl4">
</xp:pagerControl>
<xp:pagerControl type="Last"
id="pagerControl5">
</xp:pagerControl>
</xp:pager>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1"
viewName="NISDTeacher" sortColumn="$1"
search="#{javascript:viewScope.TeacherSearchFormula}">
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="CampusNum"
id="viewColumn1">
<xp:viewColumnHeader value="CampusNum"
id="viewColumnHeader1">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="$1" id="viewColumn2">
<xp:viewColumnHeader value="TeacherFull"
id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="CampusName"
id="viewColumn3">
<xp:viewColumnHeader value="CampusName"
id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="TeacherEnumber"
id="viewColumn4">
<xp:viewColumnHeader value="TeacherEnumber"
id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="TeacherPTitle"
id="viewColumn5">
<xp:viewColumnHeader value="TeacherPTitle"
id="viewColumnHeader5">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="RatingText"
id="viewColumn6">
<xp:viewColumnHeader value="RatingText"
id="viewColumnHeader6">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="RatingNum"
id="viewColumn7">
<xp:viewColumnHeader value="RatingNum"
id="viewColumnHeader7">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Comments"
id="viewColumn8">
<xp:viewColumnHeader value="Comments"
id="viewColumnHeader8">
</xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel></xp:td>
</xp:tr>
</xp:table></xp:view>

xe:dialog does not show view data

I have an xe:dialog control on my xpage, with a view contol as a sort of picklist. The view shows entries of the current db. It's in a custom control, which is embedded in
A) an xpage with data of the current database,
B) an xpage with 2 data sources, doc1 is from a different db, doc2 is from the current db.
When I open (show) the dialog in case B), the view is always empty. The xpage B) is opened from a view of the different db.
the dialog code:
<xe:dialog id="diaSnippet" title="Textbaustein auswählen">
<xp:panel>
<xe:dialogContent id="dialogContent1">
<xp:panel>
<xp:inputText id="viwStartkey1"
value="#{viewScope.viwStartkey}">
</xp:inputText>
<xp:button iconAlt="Starts with" icon="/Search" id="bviwStartkey">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="viwOrgDB1">
</xp:eventHandler>
</xp:button>
<xp:viewPanel rows="30" id="viwOrgDB1" var="kbEntry">
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="headerPager" id="pager2">
</xp:pager>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1"
startKeys="#{javascript:if (hasContent(viewScope.viwStartkey)) viewScope.viwStartkey}"
keys="#{javascript:viewScope.UpdateField}" keysExactMatch="true"
viewName="lookupSnippet" databaseName="xpages\chhp1017.nsf">
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="ID" id="viewColumn1"
displayAs="link" openDocAsReadonly="true">
<xp:viewColumnHeader value="Kurzbez."
id="viewColumnHeader1">
</xp:viewColumnHeader>
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:var mySnippet = kbEntry.getColumnValue("Snippet");
fback.replaceItemValue(viewScope.UpdateField,mySnippet)
getComponent("diaSnippet").hide(viewScope.UpdateField + "1");
</xp:eventHandler>
</xp:viewColumn>
<xp:viewColumn columnName="Snippet" id="viewColumn2">
<xp:viewColumnHeader value="Textbaustein"
id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Comment" id="viewColumn3">
<xp:viewColumnHeader value="Kommentar"
id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel>
</xp:panel>
</xe:dialogContent>
<xe:dialogButtonBar id="dialogButtonBar1">
<xp:panel>
<xp:button id="button3" value="OK">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:getComponent("diaSnippet").hide()}]]></xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:panel>
</xe:dialogButtonBar>
</xp:panel>
<xp:eventHandler event="onHide" submit="true"
refreshMode="norefresh">
</xp:eventHandler>
</xe:dialog>
I tried a few things with the data source of the dominoView, current db, chosen db like in my code above, computed db path, but all with the same result.
Looks for me as if the dialog only works when "everything" is from the current db.
Thanks in advance, Uwe
Maybe it's of any interest ....:
We found the reason: The data definition of the view was missing the
ignoreRequestParams="true"
that does the trick.

xpages full text searching

I've been following Dave's Notesin9 video on full text searching.
My source code is:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
defaultLinkTarget="_blank">
<xp:br></xp:br>
<xp:inputText id="inputText1" value="#{requestScope.variant}"></xp:inputText>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:text escape="true" id="computedField1" value="#{javascript:requestScope.variant}"></xp:text>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:button id="button3" value="Search"><xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="false" save="true"></xp:eventHandler></xp:button>
<xp:br></xp:br>
<xp:viewPanel id="viewPanel1" pageName="/p_form.xsp" rows="20">
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="headerPager" id="pager1" style="width:40.0px">
</xp:pager>
<xp:viewTitle xp:key="viewTitle" id="viewTitle1"
value="List of documents"
style="width:153.0px;background-color:rgb(64,128,128);color:rgb(255,255,0)">
</xp:viewTitle>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1" viewName="vijay"
search="#{javascript:requestScope.variant}">
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="name" id="viewColumn1"
showCheckbox="true" displayAs="link">
<xp:viewColumnHeader value="name" id="viewColumnHeader1"
style="background-color:rgb(192,192,192)">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="age" id="viewColumn2">
<xp:viewColumnHeader value="age" id="viewColumnHeader2"
style="background-color:rgb(192,192,192)">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="email" id="viewColumn3">
<xp:viewColumnHeader value="email" id="viewColumnHeader3"
style="background-color:rgb(192,192,192)">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn id="viewColumn4" style="width:89.0px"
displayAs="link" columnName="$6">
<xp:this.facets>
<xp:viewColumnHeader xp:key="header"
id="viewColumnHeader4" value="Attch">
</xp:viewColumnHeader>
</xp:this.facets>
</xp:viewColumn>
</xp:viewPanel>
<xp:button value="New Topic" id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:openPage target="newDocument" name="/p_form.xsp"></xp:openPage>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button value="Delete selected" id="button2">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:deleteSelectedDocuments view="viewPanel1"
message="Are you sure to delete it('em)?">
</xp:deleteSelectedDocuments>
</xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:view>
here, included a textfield to input the search term,
computed field to view the queried term,
a button labelled search as a submit button.
Entered value in the textfield and
when i press the search button, i get error 500.
Where lies the mistake?
Pls help.
Naveen's almost certainly spot on, that the database is not full text indexed. Check the \data\IBM_TECHNICAL_SUPPORT folder on the server, for the latest modified file starting xpages_exc_###. This will give the full detailed error, including the stack trace. The XPages Log Reader project on OpenNTF can be used to view those files from a browser.
I'd recommend using sessionScope instead of requestScope for the search value. If you use requestScope, it's only available during that partial refresh. So when the user uses a pager or opens a document and goes back to the view, the requestScope variable is null again, so the search criteria are lost.

Resources