Jsf 如何在单击h:commandButton后显示p:graphicImage

Jsf 如何在单击h:commandButton后显示p:graphicImage,jsf,jsf-2,Jsf,Jsf 2,我有一个run按钮,其中action作为从mybean调用的执行。执行按钮后,应显示运行的gif。 哪个操作应该触发running.gif的显示 这是我的密码 <h:commandButton value="Run" action="#{mybean.execute()}" class="btn btn-success btnWidth" style="margin-left:15px;margin-right:15px;"/> <p:graphicImage url="/

我有一个run按钮,其中action作为从mybean调用的执行。执行按钮后,应显示运行的gif。 哪个操作应该触发running.gif的显示

这是我的密码

<h:commandButton value="Run" action="#{mybean.execute()}" class="btn btn-success btnWidth" style="margin-left:15px;margin-right:15px;"/>

 <p:graphicImage url="/resources/icons/running.gif" height="20" width="20" />


您将如何在纯html中执行此操作?在这里尝试同样的方法。我在xhtml页面中有这一点。我只是根据这两行的逻辑只复制了这些行。清楚,但与我所说的没有任何关系。只有这段代码,jsf仅仅是一个html生成器。查看生成的html。这相当简单。看看你将如何显示(最初隐藏?)gif。并外推到jsf。但你会最喜欢的;遇到问题时,有更好的解决方案。检查PrimeFaces showcase(提示:您很可能需要ajax)