<h:commandButton value="A" action="#{juegoService.ingresarPalabra('A')}">
</h:commandButton>
我正在使用JSF 2.0,并且上面有一个按钮,对于调用该方法在页面上加载图像的每个字母,根据所按的单词将加载相应的图像,但是我需要调用该方法无需重新加载页面,因为我只能在页面上加载一个图像,因为当我单击另一个页面时,页面将重新加载Bean,而另一个图像返回到第一个状态,即该状态不收费。
您应该使用f:ajax
并刷新带有图像的容器。
<h:commandButton value="A with AJAX" id="button" action="#{juegoService.ingresarPalabra('A')}" >
<f:ajax execute="@this" render="containerId" />
</h:commandButton>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句