Skip to content
Antoine Mischler edited this page Apr 20, 2017 · 1 revision

Commit and Reload

By default, FXForm immediately updates the model when the user modifies the view or the view when the model is updated.

The default behavior can be modified by enabling buffering on the form :

 FXForm form = new FXFormBuilder().buffered(true, true).build()

Note that the buffering method takes two parameters : userInput and beanChanges controlling the buffering in both ways from user input to model and from model to user input.

User input buffering

When buffering is enabled with userInput set to true, the form won't update the model when the user interacts with the view. This can be done by calling the commit method of the form :

form.commit()

Note that calling commit() when userInput buffering is disabled will have no effect

The view can also be reseted with the current model values by calling the rollback method of the form :

form.reload()

Bean changes buffering

When buffering is enabled with beanChanges set to true, the form won't update the view when the model bean is updated. This can be done by calling the reload method of the form :

form.reload()