Skip to content

Commit

Permalink
Merge pull request #27 from bekwam/master
Browse files Browse the repository at this point in the history
Fixed spelling error and added screenshot
  • Loading branch information
bekwam committed May 15, 2017
2 parents a190922 + 1e13547 commit 1c108ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/docs/asciidoc/best-practices.asc
Expand Up @@ -796,6 +796,8 @@ There is an additional binding disabling the Downloaded Button if the track has

Since the model is based on the POJO "currentTrack", the fields must be updated manually. In some architectures, this is desired since the POJO represents record state (the state of the data from the app) and not the screen state (what the user is looking at). This means that a deliberate setter must be made to update record state and that needs to trigger a screen state update.

image::images/best-practices/bindings_select_downloaded_screenshot.png[title="A Model Change Disables the Download Button"]

In this example, there is only one field that will be modified: downloaded. Pressing the Download Button will call a setter on the special downloaded BooleanProperty of the Application. When the value of the BooleanProperty changes, the UI is updated from the tfDownloaded binding. A ChangeListener is attached to the downloaded BooleanProperty which triggers an update of the model state.

[source,java]
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1c108ba

Please sign in to comment.