This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 10, 2011, 9:36 AM
14 Posts

repeated viewPanel not working

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: xpages,Repeat Control,view panel
  • Replies: 0
Hi,

i have an XPages database containing onyl design and some configuration documents.
Some of those configuration documents point to other databases on the same server.

I have managed to display views and documents from the other databases in the center of a oneUIv2 layout.

The sessionScope.conf is populated by an initialistion routine, reading all configuration documents.
sessionScope.conf.dbsNews is a normal JavaScript array contaning JavaScript objects.

But now, while trying to use the views inside a repeat control, I am stuck with an SSJS runtime error, claiming:
Page name: /xpHome_domView.xsp (containing my custom control in an editable area)
Control id: newsPanel
Error while executing JavaScript computed expression
'newsDbObj' not found
JavaScript code: newsDbObj.dbPath


The goal is to diplay "global search" results, or in this special case, all documents modified since n days.

As you can see, the error occurs in id="newPanel". The computeField3 uses the same variable and works.
If I remove the complete viewPanel, I get a list of all db titles without errors.
If I replace the viewPanel with a dataTable and FTSearch() (see my next posting titled "repeated dataTable: hide dataTable completely if no content") it works perfectly, but I would prefer using viewPanels because of the nicer layout and less coding.
It seems, that the xp:viewPanel or this:data are executed in an other JavaScript context, where the repeat variable is invisible.

Is this a Domino bug or am I doing something wrong?
 
Thanks in advance,
  Bernd
 
The source of my custom control:
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom">
    <xp:this.dataContexts>
        <xp:dataContext var="newsSearchStr">
            <xp:this.value><![CDATA[#{javascript:"[Created]>="+sessionScope.conf.app.newsDateQry}]]></xp:this.value>
        </xp:dataContext>
    </xp:this.dataContexts>
    <xp:panel id="centerArea">
        <xp:div styleClass="viewHeader">
            <xp:text escape="true" id="computedField2">
                <xp:this.value><![CDATA[#{javascript:"New entries since " + sessionScope.conf.app.newsDays + " days"}]]></xp:this.value>
            </xp:text>
        </xp:div>

        <!-- *** repeat over all news databases array *** -->
        <xp:repeat id="repeatDbs" rows="100"
            value="#{sessionScope.conf.dbsNews}" var="newsDbObj" indexVar="idxNewsDb">

            <!-- Title of DB -->
            <xp:text escape="true" id="computedField3">
                <xp:this.value><![CDATA[#{javascript:idxNewsDb + ": " + newsDbObj.dbShort}]]></xp:this.value>
            </xp:text>
            <xp:br></xp:br>

            <!-- view xpAllDocs filtered by sessionScope.conf.app.newsDateQry -->
            <xp:viewPanel id="newsPanel" pageName="/xpMainTopic.xsp"
                showUnreadMarks="true">
                <xp:this.data>
                    <xp:dominoView var="view1"
                        search="#{javascript:newsSearchStr}"
                        databaseName="#{javascript:newsDbObj.dbPath}">
                        <xp:this.viewName><![CDATA[#{javascript:"xpAllDocs"}]]></xp:this.viewName>
                    </xp:dominoView>
                </xp:this.data>

                <!-- 3 columns for this view -->
                <xp:viewColumn columnName="xSubject" id="viewColumn4"
                    displayAs="link" openDocAsReadonly="true" width="80%">
                    <xp:viewColumnHeader value="Title" id="viewColumnHeader4"
                        sortable="true">
                    </xp:viewColumnHeader>
                </xp:viewColumn>
                <xp:viewColumn columnName="xModified" id="viewColumn5">
                    <xp:viewColumnHeader value="modified" id="viewColumnHeader5"
                        sortable="true">
                    </xp:viewColumnHeader>
                </xp:viewColumn>
                <xp:viewColumn columnName="xCategories" id="viewColumn6">
                    <xp:viewColumnHeader value="Category" id="viewColumnHeader6">
                    </xp:viewColumnHeader>
                </xp:viewColumn>
            </xp:viewPanel>
        </xp:repeat>
    </xp:panel>
</xp:view>


 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal