Domain Portal

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 7 August 2008

Glasspane in ADF Faces RC

Posted on 11:20 by Unknown
You can build very cool systems, based on excellent architecture design, with ADF BC or EJB in Model layer and with ADF Task Flows in View Controller layer. However, when it comes time for functional test, tester can break all things only with one question - why when I pressed Apply button and at the same time have pressed couple of other buttons, I got some unexpected result? Well, you probably will answer - you need to wait after Apply button is pressed some minute until operation will be finished and only after it will be done you can press other buttons. I'm sure, tester will not be satisfied with such answer, and application will not be accepted. However, things are not so bad as you can imagine, Frank Nimphius have described how to block page screen during long operation - How-to build a reusable Glasspane in ADF Faces RC. Please read Frank's article, before reading my post, since current post is completely based on it. Here I will describe with sample application how to refresh the screen to show the visual results of the long running operation.

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:
  1. filterEmployees(String firstName, String lastName) custom method from Application Module implementation class
  2. Simple Commit action
In both methods I'm using Thread.sleep(5000) in order to make those operations artificially longer. filterEmloyees custom method code:


Here is the code from Backing bean, where Glasspane is launched and closed:


There are 3 additions comparing to original Frank Nimphius article:
  1. 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.
  2. 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.
  3. 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.

Useful Update:

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.
Email ThisBlogThis!Share to XShare to Facebook
Posted in ADF, JDeveloper 11g | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Groovy - Multiple LOV's per Attribute in JDeveloper 11g
    I was blogging previously about multiple LOV's per attribute functionality. I was using RowImpl class for View object in order to calcu...
  • External Transaction Service in Oracle TopLink
    I have developed sample application, in order to demonstrate how to use External Transaction Service (ETS), when Oracle TopLink is used in M...
  • Workaround for Null Value Bug in ADF List Of Values 11g
    Those of you, who are using List Of Values (LOV) component in ADF 11g, most probably already have noticed bug related to Null value. Simple ...
  • Trip to US
    I'm in US this week, Connecticut. Here is the same weather as in Lithuania, it's winter with about -5 degrees in Celsius.
  • Oracle ADF - between 4GL and J2EE is only one step
    According to ADF architecture described in Oracle JDeveloper 10g (10.1.3) Developer's Guide Section 1.1.1 - Framework Architecture and S...
  • Creating new row using CreateInsert operation
    Sample application - CreateInsert.zip , demonstrates how to create editable table with 'create new row' functionality in ADF BC. We ...
  • Show Buttons based on Disclosed Tab
    In 11g it becomes quite common use case to structure application page with tabbed panels. If you develop your pages based on templates, most...
  • Multilanguage in fixed af:selectOneChoice ADF Faces component
    If someone will face a problem how to enable multilanguage support in fixed af:selectOneChoice component, or simply how to bind fixed af:sel...
  • JDeveloper 11g on Mac OS X Leopard
    I'm using Apple Mac Book Pro for about half of a year, but shame for me all this time I was running Windows OS using Apple Boot Camp so...
  • Why I'm here?
    Oracle for me is more then technology, it is a way how I think. So, I'm creating this blog in order to express my knowledge in Oracle Fu...

Categories

  • ADF
  • Apex
  • Apple
  • BPEL
  • Events
  • Forms
  • Groovy
  • JDeveloper 11g
  • Nomination
  • ODTUG Kaleidoscope
  • OFUG
  • Oracle Magazine
  • Oracle OpenWorld
  • Security
  • SOA
  • Spatial
  • TopLink
  • Traveling
  • Uncategorized
  • Vgo Software
  • Web Services
  • WebCenter
  • WebLogic
  • Workarounds

Blog Archive

  • ▼  2008 (72)
    • ►  December (2)
    • ►  November (3)
    • ►  October (9)
    • ►  September (4)
    • ▼  August (9)
      • Custom LOV Type Functionality in JDeveloper 11g
      • JBO-25058 and JBO-26001 exceptions
      • Show Buttons based on Disclosed Tab
      • Oracle ACE Office Hours in the OTN Lounge
      • JDeveloper 11g on Mac OS X Leopard
      • Glasspane in ADF Faces RC
      • ADF Methodology For The Masses on OOW'08
      • My Session at Oracle Open World 2008 (Oracle Develop)
      • LOV in Find Mode - Workaround for JDeveloper 11g TP4
    • ►  July (6)
    • ►  June (10)
    • ►  May (4)
    • ►  April (5)
    • ►  March (7)
    • ►  February (5)
    • ►  January (8)
  • ►  2007 (65)
    • ►  December (6)
    • ►  November (7)
    • ►  October (6)
    • ►  September (4)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
    • ►  May (5)
    • ►  April (6)
    • ►  March (4)
    • ►  February (5)
    • ►  January (9)
  • ►  2006 (9)
    • ►  December (9)
Powered by Blogger.

About Me

Unknown
View my complete profile