0

In my ADF project , I have a table component on JSF page whose value attribute is bound to method in Managed bean which returns List type object . I am able to show the data on the table but i can see the method being executed as many as 22 times ! Why the method is being called this many times and does the same thing happens with business components as well when we expose them through Data control? TIA

Edit : JSPX code :

<af:table var="row" rowBandingInterval="1"
                            autoHeightRows="10"
                            binding="#{backingBeanScope.backing_ForEachExample.t2}"
                            id="t1" partialTriggers=":::cb1"
                            styleClass="AFStretchWidth"
                            value="#{backingBeanScope.backing_ForEachExample.test2}">
                    <af:column sortable="false" headerText="col1" id="c3">
                      <af:outputText value="#{row}" id="ot2"/>
                    </af:column>
                  </af:table>

Bean Method is :

    public   List<String> gettest2(){


    /* Unique values are derived */


    List<String> tab=new ArrayList<String>();

    for(String s:uniqueValues){
        System.err.println("? Unique Value is : "+s);

              tab.add(s);      
    }     

    return tab;
    }
Brian Robbins
  • 290
  • 3
  • 17
Sid
  • 471
  • 1
  • 6
  • 19

1 Answers1

0

when you are using ADF BC, data is displayed from you VO which is exposed in AM through a data control, you can specify VO tuning properties, which determine how many records are fetched from database in one round trip. this is named in batches of. you can specify iterator's range size in sync with how many records you are fetching from database in one go and how many you need to dispay in table at UI. af:table has an attribute called fetchSize, if you set this attribute to some value equal to iterator range size say 20, and VO > Tuning > in batches of = 20, it would query only once. by default, VO in batches of is equal to 1, in that case, if you display a table with autoheightrows = 20, in this case table will query data multiple times from database.

Walker
  • 1,277
  • 10
  • 22
  • 30