Pages

Wednesday, September 7, 2016

Issue with LOV performance in ADF 12.1.3

I have an LOV defined on an attribute of a view object. The view accessor that fetches data for this LOV is not filtered and queries data from a large table. With LOV created in ADF 12.1.3, I was seeing performance issue while selecting any value in the LOV. 

Also I was seeing the below logs in the Jdeveloper console.

[142211] Evaluating Script with name:null, Type : Groovy. Expression:
[142212]  ( (FormatDesc = :vc_temp_1 ) )
[142213] Evaluation result:false

After debugging for some time, I have found a resolution for this. I need to modify the ListRangeSize parameter to a positive value eg: 10 whose value is by default set to -1 in ADF 12.1.3.

 <ListBinding
    Name="LOV_DrugName"
    ListVOName="DrugDescSearchVA"
    ListRangeSize="10"
    ComboRowCountHint="10"
    NullValueFlag="none"
    MRUCount="0">
    <AttrArray Name="AttrNames">
      <Item Value="DrugName"/>
    </AttrArray>
    <AttrArray Name="AttrExpressions"/>
    <AttrArray Name="DerivedAttrNames">
      <Item Value="ChemicalName"/>
      <Item Value="DrugSerial"/>
    </AttrArray>
    <AttrArray Name="ListAttrNames">
      <Item Value="Drug"/>
      <Item Value="Chem"/>
      <Item Value="DrugSerial"/>
    </AttrArray>
    <AttrArray Name="ListDisplayAttrNames">
      <Item Value="Drug"/>
    </AttrArray>
    <DisplayCriteria
      Name="findByDrugDesc"/>
  </ListBinding> 

How to execute code after a popup is launched

In one of my project, I had a requirement to execute some code after a popup is launched. After struggling for some time, I found a way to implement it. In this post, I will describe you one of the popup client events which can be used to execute a code after a popup is made visible.

Out of many client events that a popup supports, there is an event called popupOpened which is fired once a  popup becomes visible. You can use this event for handling custom code that should be executed once the popup is launched.

Use the below code to implement such behavior.

<af:popup id="p1">
    <af:dialog type="none" closeIconVisible="true"
               resize="off" id="d3">
        <af:panelGroupLayout id="pgl12" layout="vertical">
            ......
            ......
        </af:panelGroupLayout>
    </af:dialog>
    <af:clientListener method="<custom method>" type="popupOpened"/>
</af:popup>

Here <custom method> is the custom method name that needs to be executed.