JSF action from onChange

不问归期 提交于 2019-12-01 18:09:00

Indeed, the onchange attribute is just treated as a plain text HTML attribute which should represent a JavaScript onchange handler function. This is not different from in "plain vanilla" HTML. Any EL expressions in that attribute will just be treated as value expressions. See also the tag documentation.

Based on your question history, you're using JSF 2.x (please explicitly mention the exact JSF impl/version in future questions as many things are done differently in JSF 2.x as compared to JSF 1.x). So, just using the new JSF 2.0 <f:ajax> tag should do it.

<h:inputText ...>
    <f:ajax listener="#{timesheet.changeTotal1}" render="idOfTotalComponent" />
</h:inputText>

...

<h:outputText id="idOfTotalComponent" value="#{timesheet.total1}" />

with

public void changeTotal1(AjaxBehaviorEvent event) {
    total1 = ...;
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!