如何在 Google Web Toolkit 中捕获组件的渲染事件?

发布于 2024-08-22 12:37:36 字数 194 浏览 7 评论 0原文

我正在使用 EXT for GWT(即 GXT)构建一个应用程序。在 GXT 中,可以添加到页面的每个组件都有一个可以捕获和处理的关联渲染事件。由于某些限制,我需要在应用程序的一小部分中使用纯 GWT。具体来说,我想通过添加一些自定义样式来修改 RichTextArea 小部件。这只能在渲染 RichTextArea 组件后完成。 GWT 的 GXT 渲染事件相当于什么?

I'm building an application using EXT for GWT (i.e. GXT). In GXT, every component that can be added to a page has an associated Render event that can be captured and handled. Due to some limitations I need to step down to pure GWT for a small portion of my application. Specifically, I want to modify the RichTextArea widget by adding some custom styles. This can only be done after a RichTextArea component is rendered. What is GWT's equivalent of GXT's render event?

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

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

发布评论

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

评论(1

淡墨 2024-08-29 12:37:36

每个 GWT 小部件都有一个受保护的 onLoad 方法,该方法在小部件附加到其父级之后调用(我猜它也在此时呈现)。我的猜测是,您需要在创建 RichTextArea 小部件的小部件中重写并实现此方法,并在该小部件的 onLoad 方法中设置自定义样式,或者您可以扩展 RichTextArea 并实现 <此扩展 RichTextArea 小部件中的 code>onLoad。

Each GWT widget has a protected onLoad method, which is called after the widget is attached to it's parent (and I guess it's also rendered at that point). My guess is you need to override and implement this method in the widget you create the RichTextArea widget in and set the custom styles in the onLoad method of that widget, or you can extend the RichTextArea and implement the onLoad in this extended RichTextArea widget.

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