Domain Portal

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

Saturday, 30 August 2008

Custom LOV Type Functionality in JDeveloper 11g

Posted on 00:11 by Unknown
JDeveloper 11g together with Oracle ADF provides fully functional LOV component, in 11g you can define LOV in Model, for specific attribute in View Object (ADF BC). However, at the moment there is problem with non-model LOV, main problem - Search region for non-model based LOV not available. For example, you can check my previous sample application, developed with JDeveloper 11g TP3 - List-Of-Values Component in Search and Edit Form. In this application, I was using non-model LOV, it was based on variable in Page Definition. However, same type LOV appears differently in JDeveloper 11g TP4 - without Search region, and its not clear if it will have Search region in next release.

So, what I want to say - usually its not recommended to reinvent the weel, but in practice every developer should know how to implement similar component functionality manually. With Oracle ADF you can implement your own LOV, but if you can wait for new release, or not facing problems with standard component, may be there is no need to implement own...

You can download my sample application - CustomLOV.zip. This application demonstrates how to implement own LOV functionality. Next step will be to implement custom ADF reusable component for LOV. Similar as Glasspane ADF reusable component - Glasspane in ADF Faces RC.

Now I will describe main steps, you can follow if there will be a need to have custom LOV type functionality.

First, we need somehow to open dialog window, it can be done relatively straightforward - to put af:clientListener operation on selected af:inputText field and specify dbClick type for this action. This will allow to raise popup with LOV when dbClick event will be catched.


Popup with our custom LOV is opened using Javascript function.

LOV is based on two sections - Search parameters and table with Results:


Main trick in this application is applied for row selection from LOV. Its not a problem to select row and return it by pressing OK button. But, its little bit more complex to return selected row just by double clicking on any row. Its a problem, because selection event is fired on single selection click, but not on on double click. However, you shouldn't forget - we are using ADF, almost all problems can be solved here ;) So, what i did - I have set af:clientListener with dbClick type for Results table and additionally have set af:serverListener for the same Results table.


Idea - when user performs double click event, Javascript client listener function is invoked and this Javascript function invokes Java method declared in af:serverListener. This Java method basically will retrieve current row from Results table iterator - thats all.

Here are two Javascript functions from developed sample application:


First function is responsible for popup with LOV invocation, second reacts to dbClick event in Results table.

Java code in Backing bean is concentrated into three main methods:


First method works as Dialog Listener, this means is invoked when LOV is closed using OK button. Second method is invoked from Javascript client listener function, when dbClick event is catched in LOV Results table. Third function just retrieving value selected in LOV and assigning it to parent field.

In sample application, LOV is defined for LocationId field, just double click on this field:


Our custom LOV is opened with Search region and Results table:


You see, LOV looks like standard Oracle one, however may be even better - possible to control Results table size :) And finally, when row in Results table is double clicked, selected data is returned to parent component:

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

  • Multiple LOV's per Attribute in JDeveloper 11g
    During OOW 2008 I have attended Steve Muench talk about new features in ADF Business Components available in 11g release - Oracle ADF: New D...
  • JBO-25058 and JBO-26001 exceptions
    In a case if you will get JBO-25058 and JBO-26001 exceptions after running application developed with Oracle ADF in JDeveloper 11g, most pro...
  • JDeveloper 11g Masterclass in Vilnius
    I'm posting update to my previous post - Oracle Forms to SOA workshop in Vilnius , where I was describing masterclass session I will do ...
  • Opening Report Window in ADF Faces
    Such requirement as opening report window can be assumed as easy one. But, when I have received request for solution, it was not so easy to ...
  • Oracle JDeveloper/ADF Real Life Story on Oracle OpenWorld
    Yes, that right - I was presenting Oracle JDeveloper/ADF Real Life Story on Oracle OpenWorld in Unconference section. Everyone was free to c...
  • JDev/ADF samples list
    This week, Steve Muench on his examples page have added a link to my JDev/ADF samples list . Thanks, I'm very proud of this - it is co...
  • Oracle Always Rocks !
    This song was performed at Oracle OpenWorld 2007, after Larry Ellison and Safra Catz keynote - Sunday Night Live—30 Years Behind The Scenes ...
  • Oracle Fusion Middleware 11g Technology Preview 3 - whats included?
    Probably almost everyone have noticed Christmas gift from Oracle - JDeveloper 11g Technology Preview 3 . What new things are inside this gif...
  • List-Of-Values Component in Search and Edit Form
    Sample application described in this post contains high practical value, it implements real use case. Defined use case - based on value sele...
  • Oracle Magazine Peer-to-Peer column
    My profile is published in Oracle Magazine January/February 2008 edition - Favorite Things . Profiles of Oracle ACE Director - Chris Ostrow...

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