Java / PrimeFaces 3.5
我想回滚primeFaces selectOneMenu Old Value并重新加载它在屏幕上更新组件。
selectOneMenu加载了FIRST,SECOND,THIRD值,默认值设置为FIRST
如果我将selectOneMenu值从FIRST更改为THIRD,我想再次将其设置为FIRST。
<p:selectOneMenu id="statusProposta"
value="#{propostaBean.propostaComercial.proposta_Status}"
items="#{propostaBean.statusProposta}"
valueChangeListener="#{propostaBean.regraStatusProposta}" >
<p:ajax event="change"
process="statusProposta" update="statusProposta" />
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{propostaBean.statusProposta}" />
</p:selectOneMenu>
StatusProposta:
public enum StatusProposta {FIRST,SECOND和THIRD .....
Bean:
public void regraStatusProposta(ValueChangeEvent ev){
**I dont know how to set the old value and update it in screen.**
...
答案 0 :(得分:0)
public void regraStatusProposta(ValueChangeEvent ev){
//get old value first
Object oldValue=ev.getOldValue();
}
答案 1 :(得分:0)
http://forum.primefaces.org/viewtopic.php?f=3&t=36447
resetinput
博客文章:重置JSF 2.2的值
霍华德在primefaces论坛上发表了
http://www.primefaces.org/showcase/ui/resetInput.jsf
public void reset() {
RequestContext.getCurrentInstance().reset("form:panel");
}