2014-10-17 107 views
0

我正在使用顯示名稱的重複控制。內容是精確顯示的,但我需要一個尋呼機,因爲可能有超過30個條目。Xpages重複控制除以零

只要我爲這個重複控制添加一個尋呼機,並按下一個按鈕在網站上進行部分刷新,我就會得到一個「除零」的錯誤。

這裏是我的重複控制:

<xp:repeat id="repeat1" rows="30" var="namesList" repeatControls="true" indexVar="rowIndex"> 
    <xp:table> 
     <xp:tr> 
      <xp:td> 
       <xp:link escape="true" id="Employee"> 
        <xp:this.text><![CDATA[#{javascript:namesList.getItemValueString("Employee")}]]></xp:this.text></xp:link> 
      </xp:td> 
     </xp:tr> 
    </xp:table> 


<xp:this.value><![CDATA[#{javascript:try { 
    var wfDoc:NotesDocument = docApplication.getDocument(true); 
    var dcNoAnswer:NotesDocumentCollection = database.createDocumentCollection(); 
    var count:Integer = 0; 

    //Gets all response documents, but only adds those to the document collection, without a valid 
    //response to the cycle 
    if (wfDoc.getResponses() != null) { 
     var dc:NotesDocumentCollection = wfDoc.getResponses(); 
     var doc:NotesDocument = dc.getFirstDocument(); 

     while (doc != null) { 
      if (doc.getItemValueString("Response") == "") { 
       dcNoAnswer.addDocument(doc); 
      } 
      doc = dc.getNextDocument(); 
     }  
     dc.recycle(); 
    } 
    docApplication.replaceItemValue("MissingResponsesCount", dcNoAnswer.getCount()); 

    wfDoc.recycle(); 
    return dcNoAnswer; 
} catch(e) { 
    dBar.error("Show no response repeat control data: " + e); 
}}]]></xp:this.value> 
</xp:repeat> 

這是我的傳呼機:

<xp:pager layout="Previous Group Next" id="pager3" for="repeat1"></xp:pager> 

正如我所說的,做網站的奧德面板上的局部刷新,我會得到這個錯誤:

enter image description here

我一直在尋找一段時間的錯誤,但我在這裏看不到任何錯誤。有沒有人有這樣的問題,也許有一個解決方案?

+1

您忽略了重要部分:計算內容;-)請爲此添加您的代碼。 – 2014-10-17 11:01:42

+0

好吧,我已經添加了代碼。首先我跳過它,因爲我不想讓它變得複雜,因爲我不認爲這個代碼是問題。但是誰知道? :) – 2014-10-17 11:18:29

+0

我不確定,但我認爲你不能將文檔添加到從另一個文檔的響應中創建的集合。 – 2014-10-17 11:21:26

回答

0

你有repeatControls =「true」設置。這意味着「一次又一次創建控件」,因此您不能使用傳呼機進行導航,如此處所述。刪除repeatControls =「true」,它將起作用。

如果查看堆棧跟蹤,它將在getStart()上失敗。

+0

現在,它的工作!非常感謝你! – 2014-10-20 05:38:43

0

嘗試添加alwaysCalculateLast="false"到您的尋呼機。重複控制可能有0個值(因爲dcNoAnswer),也許你已經在你的xsp屬性設置中設置了xsp.repeat.allowZeroRowsPerPage=true