Developed sample application - GlassPaneTest.zip is based on HR schema from Oracle XE database and implements one JSPX page with search form and results table. When you will open this application in JDeveloper 11g, be sure GlassPane reusable component (JAR file) is in correct path. You can check this in JSP Tag Libraries section by opening Project Properties for ViewController:
In this application I'm running two 'long' operations:
- filterEmployees(String firstName, String lastName) custom method from Application Module implementation class
- Simple Commit action
Here is the code from Backing bean, where Glasspane is launched and closed:
There are 3 additions comparing to original Frank Nimphius article:
- In onAction(ActionEvent actionEvent) method, I'm storing Id of button component that currently activates Glasspane. I'm doing this, in order to know what logic should I invoke in queryToLaunch(ClientEvent evt) method.
- When Glasspane component is activated, it calls back queryToLaunch(ClientEvent evt) method. In this method I'm accessing stored variable with currently pressed button Id and invoking appropriate functionality.
- In order to present visual changes when operation is finished, I'm calling refreshCurrentPage() method that is doing refresh of the current page:
When I'm running this application and doing Search operation, Glasspane appears and not allows to do any changes until operation is not finished:
After operation is finished and result is returned, Glasspane disappears and user can continue his/her work:
Same applies for Save button, during Commit operation screen is blocked and user can relax until operation will be done and Glasspane will disappear :)
Additionally, in ADF Faces RC its possible to use Blocking=True property for buttons. However in most cases its not useful, since user still can do changes on the screen.
While integrating Glass Pane solution into our project, JDeveloper/ADF developer have found nice improvement. Instead of using refreshCurrentPage() method you can set PartialTriggers property for af:form tag and indicate dependency with Glass Pane popup (for example, in my sample application it will be - af:form partialtriggers="gp:busyPopup"). With this setting, page content is refreshed after popup is closed, without rerendering full page.