Page Navigation and Error Handling
857833Nov 16 2011 — edited Nov 17 2011Hi,
I have been learning JavaFX and Guice over the last week or so, and been finding zonskis tutorials at zenjava, along with fxexperience of great help in creating a framework for a new app.
I have mashed up a project in Netbeans, generic controllers, views within views type navigation, etc.
Its a basic application contains a borderpane,
1. Login page at bottom borderpane
2. Once logged in the bordpane, set bottom to null, then load menu on left, and content area in center, etc
3. Once loggoff is clicked in menu, go back to step 1
Netbeans proj download > [http://www.mediafire.com/?61cvuwcpzdo4mhx]
Now I hope I understand this correctly, here is the assumptions and questions that I have:
1. I am using Guice, so the controllers and views are loaded at startup (via the module and injector.getInstance in application.start) ?
2. When I enter details into usr/passwd on Logon page, navigate to menu, and content area, then logoff after 2nd time, the data (usr/passwd) is stored in the Logon page, (Is this because there is only one instance of the views and controllers because of Guice, and they are already loaded and caching the values)
Is the a way to clear the usr/passwd info when returning to the Logon page? see AppFx.logOffApp, i was trying to find some clear fields method on appFxController.getLogonController().getView().
Do I have to call the FXMLoader again, or clear the instance in Guice object graph somehow?
3. My question in 2, leads me to ask this:
With page navigation and so on, is there a easy solution to error handling, etc, say I have page (or a flow of multiple pages) with 100 fields and user entered data, submit to server,
a. Enter a page for the first time, user fields should be empty except for fields populated by system
b. On a page, user fills in some fields and submits to some remote server - if server returns success, clear data from screen and go to homepage, otherwise return to screen with previous data, and present error message, so user can modify if necessary