How to use to set updated value in managed bean when value of is changed

前端 未结 1 490
灰色年华
灰色年华 2020-12-07 03:21

I have a JSF page with . I want to set the value bound to the when the value is changed.

Bean:

1条回答
  •  再見小時候
    2020-12-07 03:51

    Just nest the tag within the tag.

    
        
    
    

    It'll submit the value when the HTML DOM change event has occurred (i.e. when the field was edited and then blurred).

    The event attribute already defaults to valueChange, so it's omitted. Its execute attribute already defaults to @this, so it's omitted. In case you'd like to update other component on complete, set render attribute. E.g.

    
        
    
    
    

    If you want to invoke a listener when it has been successfully set, set the listener attribute:

    
        
    
    
    public void changeIn() {
        System.out.println("in has been changed to " + in);
    }
    

    See also:

    • When to use valueChangeListener or f:ajax listener?
    • What values can I pass to the event attribute of the f:ajax tag?

    0 讨论(0)
提交回复
热议问题