Ajax for valueChangeListener

前端 未结 4 1845
礼貌的吻别
礼貌的吻别 2021-02-05 23:16

I\'m using the p:ajax listener to handle value change events (because valueChangeListener is launched on form submit):



        
4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-06 00:01

    The ValueChangeListener should work this way:

    The view:

    
      
        
      
    
    

    The bean:

    public void valueChangeListener(ValueChangeEvent e) {
      System.out.println("valueChangeListener invoked:" 
                          + " OLD: " + e.getOldValue() 
                          + " NEW: " + e.getNewValue());
    }
    

    The above code will print if I change the text field from "hello" to "world":

    valueChangeListener invoked: OLD: hello NEW: world

提交回复
热议问题