How to handle impatient end users
By Steven Davelaar on Apr 06, 2007
By using JHeadstart of course! They will get a sophisticated ADF-JSF application much faster than without JHeadstart. But that was not really the point of writing this blog entry.
A few days ago I accidentally stumbled into a very nice property of ADF Faces command buttons and command links: the boolean blocking property. Here is the online help of this property:
If set to TRUE the component will start blocking user input when the action is initiated. The blocking will stop when a response is received from the server.
So, if you have impatient end users who resubmit a page before the previous request was completed, and they complain about weird error messages, then this property is your friend! I did a quick test with a button that fires the Java sleep command for 10 seconds, and it works like a charm, the browser page is "frozen" for 10 seconds.
The save button is a typical candidate for this property, and to generate your JHeadstart application with this property you can use a custom Velocity template for your save button:
- Make a copy of saveButton.vm, name it something like blockingSaveButton.vm.
- Add the blocking="true" property to this custom template.
- Open the Application Definition Editor, select the top-level Service node, go to the Templates tab, and set the SAVE_BUTTON template to the name of your custom "blockingSave" template.
- Generate your application