我使用 anoutputText来显示计算值。我添加了一个commandButton来重置值。
<h:outputText id="lost" value="#{calculation.lost}" ></h:outputText>
<h:commandButton id="resetLost" value="Reset" action="#{calculation.setLost(0.0)}"></h:commandButton>
该setLost方法只执行这样的代码插入:lost=lost.
我假设outputText会自动更新,但值不会改变。我也尝试自动刷新页面但没有效果。我也尝试使用javascript。
是否有可能commandButton不执行该操作?为什么?这段代码有什么问题?