Icefaces 1.8 更新 iframe src

发布于 2024-12-13 00:44:19 字数 657 浏览 3 评论 0原文

该环境由 Icefaces 1.8 和 Weblogic 10.3 组成。我遇到的问题是我需要更新应用程序中 iframe 的 src 属性。出于调试目的,我使用了这个答案。问题是,警报似乎永远不会从我的应用程序内触发,代码如下:

<iframe id="iframe" onLoad="alert('Changed src');" name="iframe" src="#{backing.currentPageURL}"  width="600px" height="400px"/>

我预计每次更改 iframe 中的页面时都会看到警报。示例如下:

  1. 输入 http://www.bing.com 作为 currentPageURL 的值
  2. 搜索猫
  3. 选择关于猫的维基百科文章 //我应该在这里弹出一个窗口,但我没有

问题是如何在icefaces的上下文中修改iframe的src URL。

The environment consists of Icefaces 1.8 and Weblogic 10.3 . The issue I am experiencing is I need to update the src attribute of an iframe within my application. For debugging purposes I used this answer . The problem with that is it appears that the alert never fires from within my application, code is as follows:

<iframe id="iframe" onLoad="alert('Changed src');" name="iframe" src="#{backing.currentPageURL}"  width="600px" height="400px"/>

I would anticipate to see an alert every time I change the page within the iframe. So an example of this is as follows:

  1. Enter http://www.bing.com as the value for currentPageURL
  2. Search on cats
  3. Select the wikipedia article on cats //I should get a popup here, but I do not

The question is how do I modify the src URL of the iframe within the context of icefaces.

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

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

发布评论

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

评论(1

Saygoodbye 2024-12-20 00:44:19

您在这里有两个问题,一个是弹出窗口,另一个是用新值更新支持 bean 中的 url。

我在 Mozilla 中遇到了以下问题。

<html>
 <head>
  <title> New Document </title>
  <meta name="Author" content="roasted">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
 <body>
  <br/>  <br/>  <br/>  
  <iframe onload="javascript:alert('hey');" src="http://www.bing.com" width="800" height="800">
  </iframe>
 </body>
</html>

对于第二个问题,用新的 URL 值更新支持 bean。

  • 创建一个带有输入类型 fidden 字段的icefaces 表单。
  • 使用框架 url 值更新此隐藏字段。
  • 提交表格,您可以通过两种方式完成此操作
    • 将隐藏字段设置为partialSubmit=true,并在隐藏字段上设置valueChangeListener,以便在侦听器触发时自动调用方法。
    • 调用 Icefaces.submit(可能有点棘手)

干杯!

You have two questions here,one is for the popup and the other is for updating the url in the backing bean with the new value.

The following fires for me in Mozilla.

<html>
 <head>
  <title> New Document </title>
  <meta name="Author" content="roasted">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
 <body>
  <br/>  <br/>  <br/>  
  <iframe onload="javascript:alert('hey');" src="http://www.bing.com" width="800" height="800">
  </iframe>
 </body>
</html>

For the second question to update the backing bean with the new URL value.

  • Create a icefaces form with a input type fidden field.
  • update this hidden field with the frame url value.
  • Submit the form you can do this in two ways
    • make the hidden field with partialSubmit=true and valueChangeListener on the hidden field, so that it automcatically calls a method when the listener fires.
    • Call Icefaces.submit (may be a little tricky)

Cheers!

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