Tuesday, September 18, 2012

How to use

Use case - Upon clicking on some button, Set a value to specific attribute

Solution : <af:setPropertyListener> component allows you to set a specific value to a attribute upon clicking on a button or changing a value for any component.

Ex :


              <af:commandButton text="Save" id="cb1"
                                action="#{pageFlowScope.EmployeeBean.addEmployee}"
                                immediate="true">
                <af:setPropertyListener from="#{bindings.EmpName.inputValue}"
                                        to="#{sessionScope.EmpName}"
                                        type="action"/>
              </af:commandButton>

from/to - This value can be anything, hard coded value, binding value or from any scope variable.


No comments:

Post a Comment