How do I force an animated GIF to reload in JSF?
I have a testing application where a user is given a series of questions in the main panel. After they press submit, a feedback panel is rendered and an animated gif is displayed based on correct/incorrect answers. The animated GIF only animates the first time it's loaded in the page, but on subsequent answers it just stays in its final state.
The button works as follows:
<a:commandLink id="next"
action="#{test.nextPage}"
value="Submit Answer"
rendered="#{! test.lastpage}"
styleClass=开发者_如何学C"action-button submit next"
render="actions,testPanel,messagesPanel, lastQuestion, help"
onclick="showProcess();" oncomplete="initQuestion(); hideProcess();" />
The feedback area is as follows:
<h:panelGroup rendered="#{test.previousStatus == 'CORRECT'}">
<img src="${request.contextPath}/images/correct_animated.gif" />
</h:panelGroup>
<h:panelGroup rendered="#{test.previousStatus == 'INCORRECT'}">
<img src="${request.contextPath}/images/incorrect_animated.gif"/>
</h:panelGroup>
Any help would be much appreciated!!
Is this just in IE? Does it continue to animate in Firefox/Safari/Chrome etc?
Related link
Try to encapsulate your components into a <h:form>
tag and then rerender the panels, if its JSF 2.0 you can try:
<h:commandLink>
<f:ajax render="foo"/>
</h:commandLink>
精彩评论