Using JavaFX binding for JSF AJAX applications.
JSF 2.0 AJAX features going to the common event-driven GUI model. We could interpret Behavior as EventListener bounded to the event source on the both client and server sides. That hides and simplifies communication process for application developers, but they still have to manually define parts of page that affected by model updates and should be refreshed on the client in the same way as for old Ajax4jsf and RichFaces. But most of the modern GUI libraries, like Java Swing or JavaFX have also backward communication channels there bonded properties or models fires events on model changes which update the user interface transparently. For the JavaFX VDL implementation events from bonded properties may be used to calculate parts of page to update during AJAX request.
The manual approach, developer has to define “out1” component in the render list to update its value by AJAX. Component will be updated regardless was actual value changed or not:
Output: <h:outputText id="out1" value="#{echo.str}"/>
Input: <h:inputText id="in1" value="#{echo.str}">
<f:ajax render="out1"/>
</h:inputText>
Would be converted into:
OutputText {
label:"Output:"
value: bind echo.str
id:"out1"
},
InputText {
label:"Input"
value: echo.str
id:"in1"
valueChanged: Ajax {}
}
Input text component fires AJAX request that updates “str” attribute on the “echo” object. That update marks outputText component to be rendered by the binding “value” attribute to the same “echo.str” value. If value was not changed, component will not be rendered.