如何在 JSF 中强制重新加载动画 GIF?
我有一个测试应用程序,在主面板中向用户提出一系列问题。他们按下“提交”后,会呈现一个反馈面板,并根据正确/不正确的答案显示一个动画 gif。动画 GIF 仅在第一次加载到页面时才会显示动画,但在随后的回答中,它只会保持最终状态。
该按钮的工作原理如下:
<a:commandLink id="next"
action="#{test.nextPage}"
value="Submit Answer"
rendered="#{! test.lastpage}"
styleClass="action-button submit next"
render="actions,testPanel,messagesPanel, lastQuestion, help"
onclick="showProcess();" oncomplete="initQuestion(); hideProcess();" />
反馈区域如下:
<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>
任何帮助将不胜感激!
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="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!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这只是在IE中吗?它会继续在 Firefox/Safari/Chrome 等中显示动画吗?
相关链接
Is this just in IE? Does it continue to animate in Firefox/Safari/Chrome etc?
Related link
尝试将组件封装到
标记中,然后重新渲染面板,如果是 JSF 2.0,您可以尝试:Try to encapsulate your components into a
<h:form>
tag and then rerender the panels, if its JSF 2.0 you can try: