XPage 富文本组件

发布于 2025-01-06 06:33:57 字数 134 浏览 6 评论 0 原文

是否有机会在没有任何数据源的情况下从富文本组件获取 html 内容(mime)。我想从这样的字段中获取内容。
getComponent("FieldName").value
但这不起作用。

谢谢。

Is there any chance to get the html content (mime) from a rich text component without any datasource. I would like to grab the content from the field like this.
getComponent("FieldName").value
but this dosen't work.

thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

宁愿没拥抱 2025-01-13 06:33:57

您可以将控件绑定到作用域变量;例如,#{viewScope.comments}。然后,您可以从范围而不是从组件本身检索提交的值;例如,viewScope.get(“评论”)。

或者,您可以将 dataContext 变量设置为 JS 表达式,例如 。然后,您可以将控件绑定到 #{richText.value} 并通过相同的表达式检索它。

当然,您可以定义一个托管 bean 并将控件绑定到它的属性之一。此选项提供了最大的灵活性,但并不像上面其他两个选项那么简单。

You can bind the control to a scoped variable; for example, #{viewScope.comments}. You can then retrieve the submitted value from the scope instead of from the component itself; for example, viewScope.get("comments").

Alternatively, you can set a dataContext variable to a JS expression, e.g. <dataContext var="richText" value="#{javascript:return {value:""};}" />. Then you can bind the control to #{richText.value} and retrieve it via the same expression.

And, of course, you could define a managed bean and bind the control to one of its properties. This option provides the most flexibility, but isn't quite as simple as the other two options above.

少跟Wǒ拽 2025-01-13 06:33:57

我的问题的解决方案是

getComponent("FieldName").getValue()

感谢您的帮助。

The solution for my problem is

getComponent("FieldName").getValue()

thanks for your help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文