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

  • 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