[Solved] PPR not working on iFrame after page refresh

UI Components for JSF
Post Reply
Daedin
Posts: 25
Joined: 04 Dec 2010, 13:24

22 Dec 2010, 17:02

Hello,

I am currently working around my first issue mentioned in this post: http://primefaces.prime.com.tr/forum/vi ... 847#p27847, but am facing another one I can't get through.

I have the following form:

Code: Select all

<h:form id="gameSelectionForm">
	<h:selectOneMenu id="gameSelection">
		<f:selectItems value="#{gameBean.gameIds}" />
	</h:selectOneMenu>
	<p:commandButton id="gameSelector" action="#{gameBean.changeGame}"
		update="gameScoreFieldset, gameDiv" />
</h:form>
whose aim is to refresh the iFrame located elsewhere in the page:

Code: Select all

<h:panelGroup id="gameDiv">
        <f:verbatim>
		<iframe
			src="/levelup/resources/#{cc.attrs.src_dir}/#{cc.attrs.src_html}"
			width="700px" height="800px" frameborder="0" id="gameFrame">
		</iframe>
	</f:verbatim>
</h:panelGroup>
When I submit the form, it produces the partial response as follows:

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<partial-response>
	<changes>
		<update id="gameScoreFieldset"><![CDATA[<fieldset id="gameScoreFieldset" class="ui-fieldset ui-widget ui-widget-content ui-corner-all"><legend class="ui-fieldset-legend ui-corner-all ui-state-default">game Score</legend><div class="ui-fieldset-content"><span id="gameScore">Your score on your last game was 0.314. </span>
			<br /><span id="BestGameScore">Your best score is 18400.0.</span></div></fieldset><script type="text/javascript">widget_gameScoreFieldset = new PrimeFaces.widget.Fieldset('gameScoreFieldset', {});</script>]]></update>
		<update id="gameDiv"><![CDATA[<span id="gameDiv">
		<iframe src="/levelup/resources/games/keshin.asteroids/asteroids.html" width="700px" height="800px" frameborder="0" id="gameFrame">
		</iframe>
	</span>]]></update>
		<update id="javax.faces.ViewState"><![CDATA[-6103924633389317279:-592329718016319458]]></update>
	</changes>
	<extension primefacesCallbackParam="validationFailed">{"validationFailed":false}</extension>
</partial-response>
This response is expected, and indeed produces the refresh of the iFrame.

The problem
If I hit F5 on the page, and then submit the form, I have the same correct partial response. However, this time the iFrame is not refreshed (even though the "gameScoreFieldset" is). And looking at the rendered HTML in my browser, I can see that the source for the iFrame has not changed.

Is there something I missed in how PPR works? What seems most strange to me is that it properly works until I refresh my page.

Thanks again for your support,
Last edited by Daedin on 27 Dec 2010, 01:08, edited 1 time in total.
Sébastien

JavaServer Faces 2.0
Primefaces 2.2 RC2
Tomcat 7.0

Daedin
Posts: 25
Joined: 04 Dec 2010, 13:24

22 Dec 2010, 20:33

The issue seems to be on FireFox; it works properly on Chrome and IE.
Sébastien

JavaServer Faces 2.0
Primefaces 2.2 RC2
Tomcat 7.0

Daedin
Posts: 25
Joined: 04 Dec 2010, 13:24

25 Dec 2010, 12:17

Hello,

Seems like there is a simple answer to this issue: http://stackoverflow.com/questions/4511 ... ml-display
Sébastien

JavaServer Faces 2.0
Primefaces 2.2 RC2
Tomcat 7.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests