0

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.

Community
  • 1
  • 1
Woot4Moo
  • 23,987
  • 16
  • 94
  • 151

1 Answers1

1

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!

r0ast3d
  • 2,639
  • 1
  • 14
  • 18