title: Display Rich Text with Images in XPages Repeat Control
body: <p>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.</p>
  
  <p>I have tried several approaches, nothing has worked so far.</p>
  
  <p>I tried this solution: </p>
  
  <pre><code>rowData.getDocument().getFirstItem("Body").getMIMEEntityAsText()
  </code></pre>
  
  <p>and this one:</p>
  
  <pre><code>rowData.getDocument().getFirstItem("Body").getMIMEEntity().getContentAsText(); 
  </code></pre>
  
  <p>and this one:</p>
  
  <p><a href="http://iqjam.net/iqjam/iqjam.nsf/questions/20100914_How_to_Display_a_RichText_fiel.htm" rel="nofollow">http://iqjam.net/iqjam/iqjam.nsf/questions/20100914_How_to_Display_a_RichText_fiel.htm</a></p>
  
  <pre><code>&lt;xp:repeat id="repeat1" rows="30" value="#{view1}" var="row"&gt;
      &lt;xp:panel&gt;
          &lt;xp:this.data&gt;
              &lt;xp:dominoDocument var="doc" action="openDocument"
                  documentId="#{javascript:row.getNoteID()}"&gt;
              &lt;/xp:dominoDocument&gt;
          &lt;/xp:this.data&gt;
          &lt;xp:inputRichText id="inputRichText1" value="#{doc.ArticleContent}"
              readonly="true"&gt;
          &lt;/xp:inputRichText&gt;
      &lt;/xp:panel&gt;
  &lt;/xp:repeat&gt;
  </code></pre>
  
  <p>and this one:</p>
  
  <p><a href="http://www.ibmpressbooks.com/articles/article.asp?p=1681058&amp;seqNum=4" rel="nofollow">http://www.ibmpressbooks.com/articles/article.asp?p=1681058&amp;seqNum=4</a></p>
  
  <pre><code>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");
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>I would appreciate any suggestions...</p>