【问题标题】:How to get HTML content out of Richtext field of Notesdocument如何从 Notesdocument 的 Richtext 字段中获取 HTML 内容
【发布时间】:2019-02-14 05:18:11
【问题描述】:

enter image description hereHi 在我的 Xpages 应用程序中,我想参考存储在 NotesDocument 富文本字段(Notes Client 中的配置文档)中的 HTML,因此在 Xpages 数据源中我提到了 configDoc 作为 Notes Domino Document 的源,并且在 Default操作我将其设置为“打开文档”并在文档 ID 中“我将计算值设置如下”

var vw:NotesView = database.getView("vwConfig")
var doc:NotesDocument = vw.getFirstDocument()
var uniid:String = doc.getUniversalID();
 return uniid

在我放置在 computedField 属性上的一个地方,我提到了 ssjs 代码

return configDoc.getValue("RTFIeldasHTML").getHTML();

这在我打开文档时有效,但在我打开现有文档时无效并且它给我一个错误:

Error while executing JavaScript computed expression
docConfig.getValue()' is null

【问题讨论】:

  • 您不能使用未声明的变量,也不能在文档上使用 getValue()
  • 它适用于新文档,但如果我打开现有文档则它不起作用。 configDoc 在 Xpages 数据源中声明为 opendocument,并作为上面计算代码提供的文档 id
  • 什么是docConfig?
  • 见主帖中的图片

标签: xpages


【解决方案1】:

最可能的原因是docConfig 没有ignoreRequestParams="true"。这意味着它正在打开 ID 在 URL 中的文档,并忽略您在 documentId 属性中放置的任何内容。设置它,它将正常工作。

【讨论】:

  • Paul 你做到了,这是它缺少的东西,非常感谢。
猜你喜欢
  • 2012-01-02
  • 2021-06-19
  • 1970-01-01
  • 2014-08-21
  • 2016-06-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多