How to handle impatient end users

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
That's all, in 1 minute you added this property to the save button  in all your pages. Long live 100% generation!

Comments:

The 'Blocking' property is a great feature of ADF command buttons, but I noticed a limitation. If you click the button and then toggle to another application while the process is running, then return to the browser, it is possible to click the button again even though the process hasn't finished. Is there a way to disable the command button while the process is running even if the user toggles between Windows applications?

Posted by James Crackcorn on April 19, 2007 at 01:29 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Java EE Consultants - JHeadstart, ADF, JSF

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today