如何在 JSF 中强制重新加载动画 GIF?

发布于 2024-12-01 02:47:06 字数 843 浏览 4 评论 0原文

我有一个测试应用程序,在主面板中向用户提出一系列问题。他们按下“提交”后,会呈现一个反馈面板,并根据正确/不正确的答案显示一个动画 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 技术交流群。

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

发布评论

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

评论(2

停滞 2024-12-08 02:47:06

这只是在IE中吗?它会继续在 Firefox/Safari/Chrome 等中显示动画吗?

相关链接

Is this just in IE? Does it continue to animate in Firefox/Safari/Chrome etc?

Related link

短叹 2024-12-08 02:47:06

尝试将组件封装到 标记中,然后重新渲染面板,如果是 JSF 2.0,您可以尝试:

<h:commandLink>
    <f:ajax render="foo"/>
</h:commandLink>

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