Bob Cross
Bob Cross

Reputation: 37

Why can't I get separate documents in my xpages repeat control?

I've done this before for other projects, but can't seem to get this to work this time.

I have a repeat control that returns a list of several unids. A panel within the repeat is bound to a NotesDocument which opens the document based on each unid. ignoreRequestParams=true on the panel. Simple enough. Except, it doesn't work.

<xp:panel id="panelDetail">
    <xp:this.data>
        <xp:dominoDocument var="detdoc"
            formName="QuoteDetail" documentId="#{javascript:detdata}" 
            ignoreRequestParams="true" action="openDocument">
        </xp:dominoDocument>
    </xp:this.data>

where detdata is the var from the parent repeat control (the unid).

One of my links within the panel checks to see if my document (detdoc) is editable, however, this is the error I get.

Error calling method 'isEditable()' on an object of type 'lotus.domino.local.Document [Static Java Interface Wrapper, lotus.domino.local.Document: lotus.domino.Document]'

what gives?

I have several edit boxes in the panel that are bound to fields in the detdoc and they appear to show correctly - each row shows different values, but my computed fields that use detdoc.getItemValueString("fieldname") all show the value from the first document. ???

pic of my repeat

I've checked the properties and compared it to a previous working project and just can't put my finger on my problem here. Can someone point me in the right direction?

Upvotes: 0

Views: 113

Answers (2)

Bob Cross
Bob Cross

Reputation: 37

I found the solution. My repeat control pulled unids from documents in a view. The view used depended on a combobox above the repeat, which allowed the user to filter which entries they wanted to see. In my formula for the combobox choices, I used

var detdoc = ventry.getDocument(); var seats = detdoc.getItemValueString("SeatVars"); etc

Apparently, this usage carried over into the panel below it, so it couldn't resolve this detdoc assignment and the "detdoc" I used for the panel dominoDocument data source. I changed the combobox to use "doc" instead of "detdoc" and now my data source "detdoc" is correctly being found.

Guess I need to be a little less specific in my formulas.

Thank you for your responses - you prompted me to find the answer, and sometimes, that's all I need... just a different set of eyes and a different viewpoint. Thank you again.

EDIT: Sorry, progress made, but still not completely solved. In my panel that has detdoc defined as the datasource, I have another repeat control that displays dynamically bound fields. This means that the repeat must be defined with "Create Controls at Page Creation" checked. However, it appears that this repeat is trying to render prior to the encompassing panel being bound to detdoc, because my repeat control binding formula reports "detdoc not found". How can I use dynamic fields in my repeat when it doesn't recognize the detdoc at rendering?

Upvotes: 0

Paul Stephen Withers
Paul Stephen Withers

Reputation: 15739

Your isEditable() check appears to be being performed against the backend document (lotus.domino.local.Document), not the dominoDocument datasource. Please check the relevant component.

If your logging doesn't identify that, use XPages OpenLog Logger from OpenNTF, which will output the error and the relevant component to an OpenLog database (download OpenLog database itself from the separate OpenLog project on OpenNTF - XPages OpenLog Logger is just the XPages extension library to perform the logging).

Upvotes: 0

Related Questions