Search code examples
xpageslotus-domino

Display Rich Text with Images in XPages Repeat Control


I have a main document with a linked set of update docs, with a few fields and a rich text Body field. I am able to display any view columns from the updates in a repeat control, but I would like to display the rich text field in the repeat control as well.

I have tried several approaches, nothing has worked so far.

I tried this solution:

rowData.getDocument().getFirstItem("Body").getMIMEEntityAsText()

and this one:

rowData.getDocument().getFirstItem("Body").getMIMEEntity().getContentAsText(); 

and this one:

http://iqjam.net/iqjam/iqjam.nsf/questions/20100914_How_to_Display_a_RichText_fiel.htm

<xp:repeat id="repeat1" rows="30" value="#{view1}" var="row">
    <xp:panel>
        <xp:this.data>
            <xp:dominoDocument var="doc" action="openDocument"
                documentId="#{javascript:row.getNoteID()}">
            </xp:dominoDocument>
        </xp:this.data>
        <xp:inputRichText id="inputRichText1" value="#{doc.ArticleContent}"
            readonly="true">
        </xp:inputRichText>
    </xp:panel>
</xp:repeat>

and this one:

http://www.ibmpressbooks.com/articles/article.asp?p=1681058&seqNum=4

var nd:NotesDocument = rowData.getDocument();
var mime = nd.getMIMEEntity("body");
// if it is MIME then you can passthrough as HTML
if (mime != null) {
      return mime.getContentAsText();
}
// Otherwise just return the plain text
else {
      return nd.getItemValueString("body");
}

They both display only those docs with text only. If there is an embedded image or a mix of image and text, then nothing is displayed.

I would appreciate any suggestions...


Solution

  • So with Tim's ignoreRequestParams="true" added, this works:

    <xp:repeat id="repeat1" rows="30" value="#{view1}" var="row">
        <xp:panel>
            <xp:this.data>
                <xp:dominoDocument var="doc" action="openDocument"
                    documentId="#{javascript:row.getNoteID()}" 
                    ignoreRequestParams="true">
                </xp:dominoDocument>
            </xp:this.data>
            <xp:inputRichText id="inputRichText1" value="#{doc.ArticleContent}"
                readonly="true">
            </xp:inputRichText>
        </xp:panel>
    </xp:repeat>